Your Trusted Partner

Page 2 of 42

PHP 7 and WordPress: How to FIX unexpected ‘new’ (T_NEW) error


after I’ve upgraded my PHP to version 7 I found the following error being displayed for one plugin I was using:

Plugin could not be activated because it triggered a fatal error.

Parse error: syntax error, unexpected ‘new’ (T_NEW) in /var/www/vhosts/wp-content/plugins/smilies-themer/smilies-themer.php on line 80

The solution was pretty easy. Just open an editor on the file and line PHP tells you. Now you should see something like

$this->smilies =& new smilies_package($this->current_smilies);

Here they made some changes in PHP 7. You can’t assign classes with a & symbol anymore. So just remove that & symbol and the plugin will work fine again (search for multiple occurences).

Here you go, have fun with very fast working new PHP 7 and your (old) WordPress !

How do I set W3 total cache to automatically purge once every day?

W3TC offers some functions to flush caches[1]:

flush_pgcache(); // Page cache
flush_dbcache(); // Database cache
flush_minify(); // Minify cache
flush_all(); // All caches

And you can call it like this:


So, if you need daily purging of all caches you could use schedule recurring cron event for whatever function you want[2]. Here’s an example code you can try. I haven’t had a chance to test it though. Drop it in your theme’s functions.php file. You could create a plugin if you wanted for this too.

// Scheduled Action Hook

function w3_flush_cache( ) {

// Schedule Cron Job Event

function w3tc_cache_flush() {
if ( ! wp_next_scheduled( ‘w3_flush_cache’ ) ) {
wp_schedule_event( current_time( ‘timestamp’ ), ‘daily’, ‘w3_flush_cache’ );

add_action( ‘wp’, ‘w3tc_cache_flush’ );

Hope that helps.


[1] W3 Total Cache plugin integration

[2] Function Reference/wp schedule event

 Viktor Nagornyy

How to Fix ‘Please install Skype from the Windows Store for the best experience’ Error?

  1. Download the Skype from official Skype website
  2. If you have already downloaded Skype installation file then skip above step
  3. Now Right click on Skype installation file
  4. Select “Properties
  5. Click on “Compatibility
  6. Now tick on “Run this program in compatibility mode for”
  7. Then select “Windows 8” or “Windows 7”
  8. Click “Apply” and OK
  9. You are done! Now you can use Skype without ‘Please install Skype from the Windows Store for the best experience

Protected: Your current PHP memory limit is 128M Magento 2 requires it to be set to 756M

This content is password protected. To view it please enter your password below:

Warning : Exception printing is disabled by default for security reasons magento2

Warning : Exception printing is disabled by default for security reasons magento2

1) We will need to enable exception printing in Magento 2.
The local.xml file in Magento 2 is located in pub/errors/, now we will rename local.xml.sample to local.xml .

Then I see this error :

2) Warning: ini_set(): A session is active. You cannot change the session module’s ini settings at this time in lib/internal/Magento/Framework/Session/SessionManager.php on line 129»

Solution link :

1)Go line 129 on vendor/magento/framework/Session/SessionManager.php

Then just replace it :

// Enable session.use_only_cookies
ini_set(‘session.use_only_cookies’, ‘1’);

with the following ones:

if (!$this->isSessionExists()) {
// Enable session.use_only_cookies
ini_set(‘session.use_only_cookies’, ‘1’);

Reference Link : https://mage2.pro/t/topic/5232

« Older posts Newer posts »

© 2019 Webdesigncr3ator

Theme by Anders NorenUp ↑