How to find and remove unnecessary theme scripts? [closed]

You should locate all wp_register_script instances (they can be incuded in core, plugin, theme, anywhere) and in your functions.php you can deregister them add_action( ‘wp_enqueue_scripts’, ‘my_scripts_method’ ); function my_scripts_method() { // if you want to exclude built-in jQuery wp_deregister_script(‘jquery’); } All scripts that can be enqueued by WordPress are listed (there are handles of each) … Read more

How can i unload effect.min.js file?

If you want to remove Effect Core the you have to remove depended scripts too. Follow this to remove them: add_action( ‘wp_enqueue_scripts’, ‘remove_jquery_effects’, 100 ); function remove_jquery_effects() { wp_dequeue_script( ‘jquery-effects-core’ ); wp_dequeue_script( ‘jquery-effects-blind’ ); wp_dequeue_script( ‘jquery-effects-bounce’ ); wp_dequeue_script( ‘jquery-effects-clip’ ); wp_dequeue_script( ‘jquery-effects-drop’ ); wp_dequeue_script( ‘jquery-effects-explode’ ); wp_dequeue_script( ‘jquery-effects-fade’ ); wp_dequeue_script( ‘jquery-effects-fold’ ); wp_dequeue_script( ‘jquery-effects-highlight’ ); … Read more

How to deal with too many $_POST variable conditions from ajax request at backend? [closed]

I Would start with creating a array that hold all “conditions” logic, loop it, check to see if some condition is met and return the value. $conditions = [ ‘variable_1’ => ‘DoSomeStuffWithVariable_1’, ‘variable_1’ => ‘DoSomeStuffWithVariable_1’, ‘variable_1’ => ‘DoSomeStuffWithVariable_1’, ‘variable_xy’ => ‘DoSomeStuffWithVariable_xy’ ]; foreach ($conditions as $condition_key => $condition_value) { if (isset($_POST[$condition_key])) { $returnArray[‘return’] = $model->$condition_value(); … Read more

image resizing on post content without css and html tags

You should look at the following: https://developer.wordpress.org/reference/functions/add_image_size/ eg add this to your theme’s functions.php or plugin: add_image_size( ‘newsletter-image’, 800, 600 ); // 800 pixels wide by 600 pixels tall, soft proportional crop mode Then use the image like this: if ( has_post_thumbnail() ) { the_post_thumbnail( ‘newsletter-image’ ); }

Minimizing scripts & css files that plugins add

I would suggest using a minify plugin that will automatically combine all the scripts and styles for you. Here are a few that will do it for you: http://wordpress.org/extend/plugins/w3-total-cache/ http://wordpress.org/extend/plugins/bwp-minify/ http://wordpress.org/extend/plugins/wp-minify/ http://wordpress.org/extend/plugins/minify/

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)