plugins – How do I use composer package in wordpress?

I want to use some composer packages in my wordpress site, not set up composer package to download plugin or theme like this link https://stackoverflow.com/questions/45169430/use-composer-with-wordpress. I’m only want to use a library like that:

use PhpSpreadsheetCalculationEngine;

function setting() {
    Engine::render(); // etc
}

It can be use in every where in plugin and theme. I’ve google 1 week but I have no luck. Thanks for guilding me.

plugins – wp_login_form won’t redirect

I’m trying to change this particular part in order to redirect after login to a specific page on my site. Let’s say as an example: example.com/test. I replaced the “‘/?s=&category=&location-address=&a=true'” part with the absolute path of the page i want to redirect to, but that doesn’t seem to do it. It just keeps redirecting to the frontpage. Anything i’m missing here?

$result .= wp_login_form( array( 'redirect' => get_home_url().'/?s=&category=&location-address=&a=true', 'form_id' => 'ait-login-form-widget', 'echo' => false, 'remember' => false,) );

I followed this tutorial: https://www.ait-themes.club/knowledge-base/how-to-change-login-redirecting/

plugins – How to apply discount for registered users

I have to build a learning platform where users can buy courses. I have decided to use LearnDash. But a unique scenario here is that I have to apply a 20% discount on the course price if the user registers as a member. I am using Memberpress for members’ management. A similar plugin “Conditional Discounts” is available for WooCommerce, but how can I do this for LearnDash? Any idea?

document – How will you manage this step inside a wizard? Hard level: external plugins and valid signatures certificates needed

I’ll try to explain myself as best as I can:

I need to create a flow for sign documents in bulk. I mean, the user selects in a table a number of documents, and then the user applies the sign to all these documents.

How am I managing that? With a fullscreen wizard:

1 step: choose the sign type (without certification -easy, add only your name; and with certification -the complex way, using plugins and this stuff)

2 step review the selection of the documents (the list with the documents ready to be signed, nothing complex)

3 step result of the action (signed or error)

So, my problem is in the first step, with when you select the “sign with certificate” option because:

-First, we check (automatically) if there is a browser extension installed. If not, we should redirect to the extension install.

-Second, if we found the previous extension, we show a list of valid sign certificates previously installed by the user. So the user selects one and continues with the wizard. OR, if the user doesn’t have the signature certificate, we show the URLs to install one of the supported certificates

You can see here where all this should happen (low fidelity, sorry, haha):
Step 1 in the wizard

I’m not sure how to add these things inside a selection inside a step. I thought of adding a spinner ie: “checking certificates”. The result of this operation will be:

-No extension found: “You need to install X extension”
-Extension found, but no certificates found: “You need to add any of these valid sign certificates”
-Extension and certificates found: “Select a valid certificate”

In summary: spinner + required action.

spinner

spinner2

What do you think about this approach? I feel that this is a complex situation :/

PS: Sorry for my English

plugins – WordPress error: Options page Setting_ not found in the allowed options list

I don’t really know what to do now. :/ I tryed this:

add_action( 'admin_init', 'Setting_' );

And this is my strings and form setup:

function Setting_() {
    register_setting( 'options', 'My_plugin_header_logo' );
    register_setting( 'options', 'My_plugin_links_facebook' );
    register_setting( 'options', 'My_plugin_links_youtube' );
    register_setting( 'options', 'My_plugin_links_email' );
    register_setting( 'options', 'My_plugin_links_instagram' );
}

<form method="post" action="options.php">
 <input type="hidden" value="/wp-admin/options.php?page=my_plugin" name="_wp_http_referer">
   <p class="submit">
     <input id="submit" class="button button-primary" type="submit" name="submit" value="Save!"></p>
            </form>

Thnaks for any help!

cms – which plugins are proper to make one site for find cohabitant

ّI have seen this website (https://hamkhoone.com/) which is for finding cohabitant in Persian.

I searched to find its CMS by google and don’ find the CMS on it:
enter image description here
but found some technology used on it by wappalyzer Chrome add-ones as you can see:
enter image description here

So i like to know by installing which plugin in WordPress site?

I have made one free WordPress example on this link which could be used to test and install suggested module on it and its user name is:
Admins user name is :admin
Password is :pass

Also it would be great if you share the WordPress bask up file for building similar site if you have tried on it.

Thanks.

cms – Proper WordPress plugins to make one site for find cohabitant

ّI have seen this website (https://hamkhoone.com/) which is for finding cohabitant in Persian. Asked this question in wordpress.stackexchange.com site which detected as off topic so asked here.

I searched to find its CMS by google and don’ find the CMS on it:
enter image description here
but found some technology used on it by wappalyzer Chrome add-ones as you can see:
enter image description here

So i like to know by installing which plugin in WordPress site?

I have made one free WordPress example on this link which could be used to test and install suggested module on it and its user name is:
Admins user name is :admin
Password is :pass

Also it would be great if you share the WordPress bask up file for building similar site if you have tried on it.

Thanks.

java – Spigot Plugin: Generic form of the plugin’s main clas

I have created a lot of spigot plugins in my “carreer” as a developer for a bunch of minecraft servers, but every time I start writing a new plugin, I basically “reinvent” the structure of my main plugin class, always so it fits best into what I consider to be a readable plugin, that also other developers that will work with these plugins after me can do so without getting a headache.

My most recent Main-Class looks like this:

package com.clanplugin;

import java.math.RoundingMode;
import java.util.HashMap;

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scoreboard.Scoreboard;

import com.earth2me.essentials.api.UserDoesNotExistException;

import com.clanplugin.commands.ClanCommand;
import com.clanplugin.commands.CommandRegistry;
import com.clanplugin.commands.implementation.AcceptCommand;
import com.clanplugin.commands.implementation.CreateCommand;
import com.clanplugin.commands.implementation.DeleteCommand;
import com.clanplugin.commands.implementation.DerankCommand;
import com.clanplugin.commands.implementation.InfoCommand;
import com.clanplugin.commands.implementation.InviteCommand;
import com.clanplugin.commands.implementation.InvitesCommand;
import com.clanplugin.commands.implementation.KickCommand;
import com.clanplugin.commands.implementation.LeaveCommand;
import com.clanplugin.commands.implementation.ListCommand;
import com.clanplugin.commands.implementation.MoneyCommand;
import com.clanplugin.commands.implementation.UprankCommand;
import com.clanplugin.commands.implementation.RejectCommand;
import com.clanplugin.commands.implementation.RevokeCommand;
import com.clanplugin.commands.implementation.SetCbCommand;
import com.clanplugin.commands.implementation.SetLeaderCommand;
import com.clanplugin.commands.implementation.SetNameCommand;
import com.clanplugin.commands.implementation.SetTagCommand;
import com.clanplugin.commands.implementation.ShowMaxClanMemberCommand;
import com.clanplugin.commands.implementation.ToggleMoneyCommand;
import com.clanplugin.commands.implementation.ToplistCommand;
import com.clanplugin.database.DatabaseConnector;
import com.clanplugin.database.DatabaseMethods;
import com.clanplugin.listener.PlayerConnectListener;
import com.clanplugin.listener.PlayerDisconnectListener;
import com.clanplugin.listener.TagSetterListener;
import com.clanplugin..manager.ClantagCache;
import com.clanplugin..manager.MessageManager;
import net.ess3.api.Economy;

public class Main extends JavaPlugin {
    
    private static CommandRegistry commandRegistry;
    
    private static Main plugin;
    public static HashMap<Player, Long> lastUseOfCommand = new HashMap<Player, Long>();

    public void onEnable() {
        plugin = this;

        saveDefaultConfig();
        registerCommands();
        registerListeners();
        loadDatabase();
        setDataUponReload();
    }

    public void onDisable() {
        DatabaseConnector.disconnect();

        System.out.println(MessageManager.disabledPluginConsoleMessage());
        plugin = null;
    }

    public static Main getInstance() {
        return plugin;
    }

    private void loadDatabase() {
        DatabaseConnector.connect();
        DatabaseMethods.initialiseDatabaseTables();
    }
    
    private void registerCommands() {
        this.getCommand("clan").setExecutor(new ClanCommand());
        
        commandRegistry = new CommandRegistry();
        
        commandRegistry.registerCommand(new ShowMaxClanMemberCommand());
        commandRegistry.registerCommand(new ListCommand());
        commandRegistry.registerCommand(new LeaveCommand());
        commandRegistry.registerCommand(new DeleteCommand());
        commandRegistry.registerCommand(new InvitesCommand());
        commandRegistry.registerCommand(new ToplistCommand());
        commandRegistry.registerCommand(new MoneyCommand());
        commandRegistry.registerCommand(new ToggleMoneyCommand());
        
        commandRegistry.registerCommand(new InviteCommand());
        commandRegistry.registerCommand(new AcceptCommand());
        commandRegistry.registerCommand(new RejectCommand());
        commandRegistry.registerCommand(new KickCommand());
        commandRegistry.registerCommand(new RevokeCommand());
        commandRegistry.registerCommand(new InfoCommand());
        commandRegistry.registerCommand(new SetTagCommand());
        commandRegistry.registerCommand(new SetNameCommand());
        commandRegistry.registerCommand(new SetLeaderCommand());
        commandRegistry.registerCommand(new UprankCommand());
        commandRegistry.registerCommand(new DerankCommand());
        commandRegistry.registerCommand(new SetCbCommand());

        commandRegistry.registerCommand(new CreateCommand());
        
        
    }
    
    public static CommandRegistry getCommandRegistry() {
        return commandRegistry;
    }
    
    private void registerListeners() {
        getServer().getPluginManager().registerEvents(new PlayerConnectListener(), this);
        getServer().getPluginManager().registerEvents(new PlayerDisconnectListener(), this);
        getServer().getPluginManager().registerEvents(new TagSetterListener(), this);
    }
    
    private void setDataUponReload() {
        for(Player player : Bukkit.getOnlinePlayers()) {
            if (DatabaseMethods.isPlayerInClan(player.getUniqueId())) {
                String playerUUID = DatabaseMethods.getPlayerUUID(player.getUniqueId());
                if (playerUUID.equals(player.getUniqueId().toString()))
                    DatabaseMethods.addPlayerName(player.getName(), player.getUniqueId());

                ClantagCache.put(player, DatabaseMethods.getClanTagByClanID(DatabaseMethods.getClanIDByPlayerUuid(player.getUniqueId())));
            }
            
            PlayerConnectListener.joinTimes.put(player, System.currentTimeMillis());
        }
    }
    
    @SuppressWarnings("deprecation")
    public static void updateScoreBoard(Player player) {
        try {

        if (player == null || player.getScoreboard() == null) {
            return;
        }

        Scoreboard board = player.getScoreboard();

        if (Bukkit.getOnlinePlayers().size() == 0) {

            board.getTeam("onlineplayers").setPrefix(" " + "0" + "/" + "" + Bukkit.getServer().getMaxPlayers());

        } else {

            board.getTeam("onlineplayers")
                    .setPrefix("" + Bukkit.getOnlinePlayers().size() + "/" + Bukkit.getServer().getMaxPlayers());

        }

        try {
            board.getTeam("Kontostandcheck")
                    .setPrefix("" + Economy.getMoneyExact(player.getName()).setScale(2, RoundingMode.DOWN) + "$");
        } catch (IllegalStateException | IllegalArgumentException | UserDoesNotExistException e) {
            e.printStackTrace();
        }
        
        } catch (Exception e) {
            System.out.println("(ClanSystem) This is not the live environement or the scoreboard configuration has changed. Please review carefully.");
            e.printStackTrace();
        }

    }

}

It would be great to get some fresh idea’s what can be improved, maybe not only regarding the spigot-related stuff, but also maybe some general bad habits I might have. Thanks a lot in advance! If you have any questions to some functionality of the classes feel free to ask me about it in the comments 🙂

When I viewed the page source, I saw that CDATA provides information about plugins. How can I prevent this?

When I viewed the page source, I saw that CDATA provides information about plugins. For example, it shows recaptcha site key data for contact form 7 plugin. What is it, why does it show and how can I prevent it?

<script src="https://www.google.com/recaptcha/api.js?render=XXXXXXXXX" id="google-recaptcha-js"></script>
<script type='text/javascript' id='wpcf7-recaptcha-js-extra'>
/* <![CDATA[ */
var wpcf7_recaptcha = {"sitekey":"XXXXXXXXX","actions":{"homepage":"homepage","contactform":"contactform"}};
/* ]]> */

plugins – Need help with my new site

I want to just have a landing page with drop down categories people can choose from then click a button that randomizes within those filters an affiliate product.

What are the best theme/plugins to do about that?

So someone goes to my site and they (not my niche but an example):

All on the front page:

Dropdown 1: Type of car. Dropdown 2: say the price or something then they just click on the button and it randomizes within those filters to display a single random affiliate product that will be directly linked.
Am I asking too much or is there a better way for what I’m wanting? Thanks.
Quote ReplyReport