WP-Optimize - Version 2.2.9

Version Description

  • 03/Jan/2019 =

  • FIX: Change a newly-introduced fragment that was not compatible with PHP 5.2

  • TWEAK: Tweak some other code that had PHP 5.2 compatibility issues

Download this release

Release Info

Developer DavidAnderson
Plugin Icon 128x128 WP-Optimize
Version 2.2.9
Comparing to
See all releases

Code changes from version 2.2.8 to 2.2.9

includes/class-commands.php CHANGED
@@ -405,7 +405,8 @@ class WP_Optimize_Commands {
405
 
406
  $settings = json_decode($params['settings'], true);
407
 
408
- // check if valid json file posted.
 
409
  if ((function_exists('json_last_error') && 0 != json_last_error()) || empty($settings)) {
410
  return array('errors' => array(__('Please upload a valid settings file.', 'wp-optimize')));
411
  }
405
 
406
  $settings = json_decode($params['settings'], true);
407
 
408
+ // check if valid json file posted (requires PHP 5.3+)
409
+ // @codingStandardsIgnoreLine
410
  if ((function_exists('json_last_error') && 0 != json_last_error()) || empty($settings)) {
411
  return array('errors' => array(__('Please upload a valid settings file.', 'wp-optimize')));
412
  }
includes/class-updraft-smush-manager.php CHANGED
@@ -464,12 +464,14 @@ class Updraft_Smush_Manager extends Updraft_Task_Manager_1_0 {
464
  $compressed = get_post_meta($post->ID, 'smush-complete', true) ? true : false;
465
  $has_backup = get_post_meta($post->ID, 'original-file', true) ? true : false;
466
 
 
 
467
  $extract = array(
468
  'post_id' => $post->ID,
469
  'smush_display' => $compressed ? "style='display:none;'" : "style='display:block;'",
470
  'restore_display' => $compressed ? "style='display:block;'" : "style='display:none;'",
471
  'restore_action' => $has_backup ? "style='display:block;'" : "style='display:none;'",
472
- 'smush_info' => get_post_meta($post->ID, 'smush-info', true) ?: " ",
473
  'file_size' => filesize(get_attached_file($post->ID))
474
  );
475
 
464
  $compressed = get_post_meta($post->ID, 'smush-complete', true) ? true : false;
465
  $has_backup = get_post_meta($post->ID, 'original-file', true) ? true : false;
466
 
467
+ $smush_info = get_post_meta($post->ID, 'smush-info', true);
468
+
469
  $extract = array(
470
  'post_id' => $post->ID,
471
  'smush_display' => $compressed ? "style='display:none;'" : "style='display:block;'",
472
  'restore_display' => $compressed ? "style='display:block;'" : "style='display:none;'",
473
  'restore_action' => $has_backup ? "style='display:block;'" : "style='display:none;'",
474
+ 'smush_info' => $smush_info ? $smush_info : ' ',
475
  'file_size' => filesize(get_attached_file($post->ID))
476
  );
477
 
includes/class-updraft-smush-task.php CHANGED
@@ -182,7 +182,7 @@ abstract class Updraft_Smush_Task extends Updraft_Task_1_0 {
182
  $original_size = $this->get_option('original_filesize');
183
  $this->set_current_stage('completed');
184
 
185
- clearstatcache(true, $file_path);
186
  $saved = round((($original_size - filesize($file_path)) / $original_size * 100), 2);
187
  $info = sprintf(__("The file was compressed from %s to %s saving %s percent using WP-Optimize", 'wp-optimize'), $this->format_filesize($original_size), $this->format_filesize(filesize($file_path)), $saved);
188
 
182
  $original_size = $this->get_option('original_filesize');
183
  $this->set_current_stage('completed');
184
 
185
+ clearstatcache(true, $file_path); // phpcs:ignore PHPCompatibility.FunctionUse.NewFunctionParameters.clearstatcache_clear_realpath_cacheFound,PHPCompatibility.FunctionUse.NewFunctionParameters.clearstatcache_filenameFound
186
  $saved = round((($original_size - filesize($file_path)) / $original_size * 100), 2);
187
  $info = sprintf(__("The file was compressed from %s to %s saving %s percent using WP-Optimize", 'wp-optimize'), $this->format_filesize($original_size), $this->format_filesize(filesize($file_path)), $saved);
188
 
languages/wp-optimize.pot CHANGED
@@ -21,7 +21,7 @@ msgstr ""
21
  msgid "No optimization was indicated."
22
  msgstr ""
23
 
24
- #: src/includes/class-commands.php:401, src/includes/class-commands.php:410
25
  msgid "Please upload a valid settings file."
26
  msgstr ""
27
 
@@ -225,7 +225,7 @@ msgstr ""
225
  msgid "Trackbacks have now been enabled on all current and previously published posts."
226
  msgstr ""
227
 
228
- #: src/includes/wp-optimize-database-information.php:411, src/includes/wp-optimize-database-information.php:456, src/templates/database/tables-body.php:29, src/wp-optimize.php:880
229
  msgid "WordPress core"
230
  msgstr ""
231
 
@@ -789,7 +789,7 @@ msgstr ""
789
  msgid "FAQs"
790
  msgstr ""
791
 
792
- #: src/templates/admin-page-header.php:22, src/templates/pages-menu.php:41, src/wp-optimize.php:1068, src/wp-optimize.php:1069
793
  msgid "More plugins"
794
  msgstr ""
795
 
@@ -821,11 +821,11 @@ msgstr ""
821
  msgid "disabled"
822
  msgstr ""
823
 
824
- #: src/templates/cache/browser-cache.php:32, src/wp-optimize.php:786
825
  msgid "Update"
826
  msgstr ""
827
 
828
- #: src/templates/cache/browser-cache.php:32, src/templates/cache/gzip-compression.php:43, src/templates/settings/settings-trackback-and-comments.php:13, src/templates/settings/settings-trackback-and-comments.php:29, src/wp-optimize.php:775, src/wp-optimize.php:785
829
  msgid "Enable"
830
  msgstr ""
831
 
@@ -861,7 +861,7 @@ msgstr ""
861
  msgid "Gzip compression is currently DISABLED."
862
  msgstr ""
863
 
864
- #: src/templates/cache/gzip-compression.php:43, src/templates/settings/settings-trackback-and-comments.php:15, src/templates/settings/settings-trackback-and-comments.php:31, src/wp-optimize.php:776
865
  msgid "Disable"
866
  msgstr ""
867
 
@@ -881,7 +881,7 @@ msgstr ""
881
  msgid "Warning: This operation is permanent. Continue?"
882
  msgstr ""
883
 
884
- #: src/templates/database/optimize-table.php:25, src/wp-optimize.php:484
885
  msgid "Optimizations"
886
  msgstr ""
887
 
@@ -1563,178 +1563,178 @@ msgstr ""
1563
  msgid "New feature: WP-Optimize Premium can now optimize all sites within a multisite install, not just the main one."
1564
  msgstr ""
1565
 
1566
- #: src/wp-optimize.php:481, src/wp-optimize.php:854, src/wp-optimize.php:1031, src/wp-optimize.php:1032
1567
  msgid "Settings"
1568
  msgstr ""
1569
 
1570
- #: src/wp-optimize.php:484
1571
  msgid "Tables"
1572
  msgstr ""
1573
 
1574
- #: src/wp-optimize.php:486
1575
  msgid "Gzip compression"
1576
  msgstr ""
1577
 
1578
- #: src/wp-optimize.php:487
1579
  msgid "Static file caching"
1580
  msgstr ""
1581
 
1582
- #: src/wp-optimize.php:489
1583
  msgid "Support / FAQs"
1584
  msgstr ""
1585
 
1586
- #: src/wp-optimize.php:490
1587
  msgid "Premium / Plugin family"
1588
  msgstr ""
1589
 
1590
- #: src/wp-optimize.php:770
1591
  msgid "Automatic backup before optimizations"
1592
  msgstr ""
1593
 
1594
- #: src/wp-optimize.php:771
1595
  msgid "An unexpected response was received."
1596
  msgstr ""
1597
 
1598
- #: src/wp-optimize.php:772
1599
  msgid "Optimization complete"
1600
  msgstr ""
1601
 
1602
- #: src/wp-optimize.php:773
1603
  msgid "Run optimizations"
1604
  msgstr ""
1605
 
1606
- #: src/wp-optimize.php:774
1607
  msgid "Cancel"
1608
  msgstr ""
1609
 
1610
- #: src/wp-optimize.php:777
1611
  msgid "Please, select settings file."
1612
  msgstr ""
1613
 
1614
- #: src/wp-optimize.php:778
1615
  msgid "Are you sure you want to remove this logging destination?"
1616
  msgstr ""
1617
 
1618
- #: src/wp-optimize.php:779
1619
  msgid "Before saving, you need to complete the currently incomplete settings (or remove them)."
1620
  msgstr ""
1621
 
1622
- #: src/wp-optimize.php:780
1623
  msgid "%s was not repaired. For more details, please check the logs (configured in your logging destinations settings)."
1624
  msgstr ""
1625
 
1626
- #: src/wp-optimize.php:781
1627
  msgid "Are you sure you want to remove this table?"
1628
  msgstr ""
1629
 
1630
- #: src/wp-optimize.php:782
1631
  msgid "%s was not deleted. For more details, please check your logs configured in logging destinations settings."
1632
  msgstr ""
1633
 
1634
- #: src/wp-optimize.php:783
1635
  msgid "Please use positive integers."
1636
  msgstr ""
1637
 
1638
- #: src/wp-optimize.php:784
1639
  msgid "Please use valid values."
1640
  msgstr ""
1641
 
1642
- #: src/wp-optimize.php:857
1643
  msgid "Optimizer"
1644
  msgstr ""
1645
 
1646
- #: src/wp-optimize.php:873
1647
  msgid "Repair"
1648
  msgstr ""
1649
 
1650
- #: src/wp-optimize.php:884
1651
  msgid "Remove"
1652
  msgstr ""
1653
 
1654
- #: src/wp-optimize.php:991
1655
  msgid "Warning"
1656
  msgstr ""
1657
 
1658
- #: src/wp-optimize.php:991
1659
  msgid "WordPress has a number (%d) of scheduled tasks which are overdue. Unless this is a development site, this probably means that the scheduler in your WordPress install is not working."
1660
  msgstr ""
1661
 
1662
- #: src/wp-optimize.php:991
1663
  msgid "Read this page for a guide to possible causes and how to fix it."
1664
  msgstr ""
1665
 
1666
- #: src/wp-optimize.php:1045, src/wp-optimize.php:1046
1667
  msgid "Database"
1668
  msgstr ""
1669
 
1670
- #: src/wp-optimize.php:1059
1671
  msgid "Support & FAQs"
1672
  msgstr ""
1673
 
1674
- #: src/wp-optimize.php:1060
1675
  msgid "Help"
1676
  msgstr ""
1677
 
1678
- #: src/wp-optimize.php:1081, src/wp-optimize.php:1082
1679
  msgid "Cache"
1680
  msgstr ""
1681
 
1682
- #: src/wp-optimize.php:1144
1683
  msgid "Error:"
1684
  msgstr ""
1685
 
1686
- #: src/wp-optimize.php:1144
1687
  msgid "template not found"
1688
  msgstr ""
1689
 
1690
- #: src/wp-optimize.php:1196
1691
  msgid "Automatic Operation Completed"
1692
  msgstr ""
1693
 
1694
- #: src/wp-optimize.php:1198
1695
  msgid "Scheduled optimization was executed at"
1696
  msgstr ""
1697
 
1698
- #: src/wp-optimize.php:1199
1699
  msgid "You can safely delete this email."
1700
  msgstr ""
1701
 
1702
- #: src/wp-optimize.php:1201
1703
  msgid "Regards,"
1704
  msgstr ""
1705
 
1706
- #: src/wp-optimize.php:1202
1707
  msgid "WP-Optimize Plugin"
1708
  msgstr ""
1709
 
1710
- #: src/wp-optimize.php:1224
1711
  msgid "GB"
1712
  msgstr ""
1713
 
1714
- #: src/wp-optimize.php:1226
1715
  msgid "MB"
1716
  msgstr ""
1717
 
1718
- #: src/wp-optimize.php:1228
1719
  msgid "KB"
1720
  msgstr ""
1721
 
1722
- #: src/wp-optimize.php:1230
1723
  msgid "bytes"
1724
  msgstr ""
1725
 
1726
- #: src/wp-optimize.php:1549
1727
  msgid "You have no permissions to run optimizations."
1728
  msgstr ""
1729
 
1730
- #: src/wp-optimize.php:1556
1731
  msgid "You have no permissions to manage WP-Optimize settings."
1732
  msgstr ""
1733
 
1734
- #: src/wp-optimize.php:1706
1735
  msgid "Only Network Administrator can activate WP-Optimize plugin."
1736
  msgstr ""
1737
 
1738
- #: src/wp-optimize.php:1707
1739
  msgid "go back"
1740
  msgstr ""
21
  msgid "No optimization was indicated."
22
  msgstr ""
23
 
24
+ #: src/includes/class-commands.php:401, src/includes/class-commands.php:411
25
  msgid "Please upload a valid settings file."
26
  msgstr ""
27
 
225
  msgid "Trackbacks have now been enabled on all current and previously published posts."
226
  msgstr ""
227
 
228
+ #: src/includes/wp-optimize-database-information.php:411, src/includes/wp-optimize-database-information.php:456, src/templates/database/tables-body.php:29, src/wp-optimize.php:882
229
  msgid "WordPress core"
230
  msgstr ""
231
 
789
  msgid "FAQs"
790
  msgstr ""
791
 
792
+ #: src/templates/admin-page-header.php:22, src/templates/pages-menu.php:41, src/wp-optimize.php:1070, src/wp-optimize.php:1071
793
  msgid "More plugins"
794
  msgstr ""
795
 
821
  msgid "disabled"
822
  msgstr ""
823
 
824
+ #: src/templates/cache/browser-cache.php:32, src/wp-optimize.php:788
825
  msgid "Update"
826
  msgstr ""
827
 
828
+ #: src/templates/cache/browser-cache.php:32, src/templates/cache/gzip-compression.php:43, src/templates/settings/settings-trackback-and-comments.php:13, src/templates/settings/settings-trackback-and-comments.php:29, src/wp-optimize.php:777, src/wp-optimize.php:787
829
  msgid "Enable"
830
  msgstr ""
831
 
861
  msgid "Gzip compression is currently DISABLED."
862
  msgstr ""
863
 
864
+ #: src/templates/cache/gzip-compression.php:43, src/templates/settings/settings-trackback-and-comments.php:15, src/templates/settings/settings-trackback-and-comments.php:31, src/wp-optimize.php:778
865
  msgid "Disable"
866
  msgstr ""
867
 
881
  msgid "Warning: This operation is permanent. Continue?"
882
  msgstr ""
883
 
884
+ #: src/templates/database/optimize-table.php:25, src/wp-optimize.php:486
885
  msgid "Optimizations"
886
  msgstr ""
887
 
1563
  msgid "New feature: WP-Optimize Premium can now optimize all sites within a multisite install, not just the main one."
1564
  msgstr ""
1565
 
1566
+ #: src/wp-optimize.php:483, src/wp-optimize.php:856, src/wp-optimize.php:1033, src/wp-optimize.php:1034
1567
  msgid "Settings"
1568
  msgstr ""
1569
 
1570
+ #: src/wp-optimize.php:486
1571
  msgid "Tables"
1572
  msgstr ""
1573
 
1574
+ #: src/wp-optimize.php:488
1575
  msgid "Gzip compression"
1576
  msgstr ""
1577
 
1578
+ #: src/wp-optimize.php:489
1579
  msgid "Static file caching"
1580
  msgstr ""
1581
 
1582
+ #: src/wp-optimize.php:491
1583
  msgid "Support / FAQs"
1584
  msgstr ""
1585
 
1586
+ #: src/wp-optimize.php:492
1587
  msgid "Premium / Plugin family"
1588
  msgstr ""
1589
 
1590
+ #: src/wp-optimize.php:772
1591
  msgid "Automatic backup before optimizations"
1592
  msgstr ""
1593
 
1594
+ #: src/wp-optimize.php:773
1595
  msgid "An unexpected response was received."
1596
  msgstr ""
1597
 
1598
+ #: src/wp-optimize.php:774
1599
  msgid "Optimization complete"
1600
  msgstr ""
1601
 
1602
+ #: src/wp-optimize.php:775
1603
  msgid "Run optimizations"
1604
  msgstr ""
1605
 
1606
+ #: src/wp-optimize.php:776
1607
  msgid "Cancel"
1608
  msgstr ""
1609
 
1610
+ #: src/wp-optimize.php:779
1611
  msgid "Please, select settings file."
1612
  msgstr ""
1613
 
1614
+ #: src/wp-optimize.php:780
1615
  msgid "Are you sure you want to remove this logging destination?"
1616
  msgstr ""
1617
 
1618
+ #: src/wp-optimize.php:781
1619
  msgid "Before saving, you need to complete the currently incomplete settings (or remove them)."
1620
  msgstr ""
1621
 
1622
+ #: src/wp-optimize.php:782
1623
  msgid "%s was not repaired. For more details, please check the logs (configured in your logging destinations settings)."
1624
  msgstr ""
1625
 
1626
+ #: src/wp-optimize.php:783
1627
  msgid "Are you sure you want to remove this table?"
1628
  msgstr ""
1629
 
1630
+ #: src/wp-optimize.php:784
1631
  msgid "%s was not deleted. For more details, please check your logs configured in logging destinations settings."
1632
  msgstr ""
1633
 
1634
+ #: src/wp-optimize.php:785
1635
  msgid "Please use positive integers."
1636
  msgstr ""
1637
 
1638
+ #: src/wp-optimize.php:786
1639
  msgid "Please use valid values."
1640
  msgstr ""
1641
 
1642
+ #: src/wp-optimize.php:859
1643
  msgid "Optimizer"
1644
  msgstr ""
1645
 
1646
+ #: src/wp-optimize.php:875
1647
  msgid "Repair"
1648
  msgstr ""
1649
 
1650
+ #: src/wp-optimize.php:886
1651
  msgid "Remove"
1652
  msgstr ""
1653
 
1654
+ #: src/wp-optimize.php:993
1655
  msgid "Warning"
1656
  msgstr ""
1657
 
1658
+ #: src/wp-optimize.php:993
1659
  msgid "WordPress has a number (%d) of scheduled tasks which are overdue. Unless this is a development site, this probably means that the scheduler in your WordPress install is not working."
1660
  msgstr ""
1661
 
1662
+ #: src/wp-optimize.php:993
1663
  msgid "Read this page for a guide to possible causes and how to fix it."
1664
  msgstr ""
1665
 
1666
+ #: src/wp-optimize.php:1047, src/wp-optimize.php:1048
1667
  msgid "Database"
1668
  msgstr ""
1669
 
1670
+ #: src/wp-optimize.php:1061
1671
  msgid "Support & FAQs"
1672
  msgstr ""
1673
 
1674
+ #: src/wp-optimize.php:1062
1675
  msgid "Help"
1676
  msgstr ""
1677
 
1678
+ #: src/wp-optimize.php:1083, src/wp-optimize.php:1084
1679
  msgid "Cache"
1680
  msgstr ""
1681
 
1682
+ #: src/wp-optimize.php:1146
1683
  msgid "Error:"
1684
  msgstr ""
1685
 
1686
+ #: src/wp-optimize.php:1146
1687
  msgid "template not found"
1688
  msgstr ""
1689
 
1690
+ #: src/wp-optimize.php:1198
1691
  msgid "Automatic Operation Completed"
1692
  msgstr ""
1693
 
1694
+ #: src/wp-optimize.php:1200
1695
  msgid "Scheduled optimization was executed at"
1696
  msgstr ""
1697
 
1698
+ #: src/wp-optimize.php:1201
1699
  msgid "You can safely delete this email."
1700
  msgstr ""
1701
 
1702
+ #: src/wp-optimize.php:1203
1703
  msgid "Regards,"
1704
  msgstr ""
1705
 
1706
+ #: src/wp-optimize.php:1204
1707
  msgid "WP-Optimize Plugin"
1708
  msgstr ""
1709
 
1710
+ #: src/wp-optimize.php:1226
1711
  msgid "GB"
1712
  msgstr ""
1713
 
1714
+ #: src/wp-optimize.php:1228
1715
  msgid "MB"
1716
  msgstr ""
1717
 
1718
+ #: src/wp-optimize.php:1230
1719
  msgid "KB"
1720
  msgstr ""
1721
 
1722
+ #: src/wp-optimize.php:1232
1723
  msgid "bytes"
1724
  msgstr ""
1725
 
1726
+ #: src/wp-optimize.php:1551
1727
  msgid "You have no permissions to run optimizations."
1728
  msgstr ""
1729
 
1730
+ #: src/wp-optimize.php:1558
1731
  msgid "You have no permissions to manage WP-Optimize settings."
1732
  msgstr ""
1733
 
1734
+ #: src/wp-optimize.php:1708
1735
  msgid "Only Network Administrator can activate WP-Optimize plugin."
1736
  msgstr ""
1737
 
1738
+ #: src/wp-optimize.php:1709
1739
  msgid "go back"
1740
  msgstr ""
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://david.dw-perspective.org.uk/donate
4
  Tags: comments, spam, optimize, database, revisions, users, posts, trash, schedule, automatic, clean, phpmyadmin, meta, postmeta, responsive, mobile
5
  Requires at least: 3.8
6
  Tested up to: 5.0
7
- Stable tag: 2.2.8
8
  License: GPLv2+
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -143,9 +143,10 @@ Please check your database for corrupted tables. That can happen, usually your w
143
 
144
  == Changelog ==
145
 
146
- = 2.2.8 - 03/Jan/2019 =
147
 
148
  * FIX: Change a newly-introduced fragment that was not compatible with PHP 5.2
 
149
 
150
  = 2.2.7 - 31/December/2018 =
151
 
@@ -451,4 +452,4 @@ Please check your database for corrupted tables. That can happen, usually your w
451
  * Fix Interface
452
 
453
  == Upgrade Notice ==
454
- * 2.2.8 : Fix an issue in PHP 5.2
4
  Tags: comments, spam, optimize, database, revisions, users, posts, trash, schedule, automatic, clean, phpmyadmin, meta, postmeta, responsive, mobile
5
  Requires at least: 3.8
6
  Tested up to: 5.0
7
+ Stable tag: 2.2.9
8
  License: GPLv2+
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
143
 
144
  == Changelog ==
145
 
146
+ = 2.2.9 - 03/Jan/2019 =
147
 
148
  * FIX: Change a newly-introduced fragment that was not compatible with PHP 5.2
149
+ * TWEAK: Tweak some other code that had PHP 5.2 compatibility issues
150
 
151
  = 2.2.7 - 31/December/2018 =
152
 
452
  * Fix Interface
453
 
454
  == Upgrade Notice ==
455
+ * 2.2.9 : Fix issues when running on PHP 5.2
wp-optimize.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP-Optimize
4
  Plugin URI: https://getwpo.com
5
  Description: WP-Optimize is WordPress's #1 most installed optimization plugin. With it, you can clean up your database easily and safely, without manual queries.
6
- Version: 2.2.8
7
  Author: David Anderson, Ruhani Rabin, Team Updraft
8
  Author URI: https://updraftplus.com
9
  Text Domain: wp-optimize
@@ -15,7 +15,7 @@ if (!defined('ABSPATH')) die('No direct access allowed');
15
 
16
  // Check to make sure if WP_Optimize is already call and returns.
17
  if (!class_exists('WP_Optimize')) :
18
- define('WPO_VERSION', '2.2.8');
19
  define('WPO_PLUGIN_URL', plugin_dir_url(__FILE__));
20
  define('WPO_PLUGIN_MAIN_PATH', plugin_dir_path(__FILE__));
21
  define('WPO_PREMIUM_NOTIFICATION', false);
@@ -449,7 +449,9 @@ class WP_Optimize {
449
 
450
  $result = json_encode($results);
451
 
452
- $json_last_error = json_last_error();
 
 
453
 
454
  // if json_encode returned error then return error.
455
  if ($json_last_error) {
3
  Plugin Name: WP-Optimize
4
  Plugin URI: https://getwpo.com
5
  Description: WP-Optimize is WordPress's #1 most installed optimization plugin. With it, you can clean up your database easily and safely, without manual queries.
6
+ Version: 2.2.9
7
  Author: David Anderson, Ruhani Rabin, Team Updraft
8
  Author URI: https://updraftplus.com
9
  Text Domain: wp-optimize
15
 
16
  // Check to make sure if WP_Optimize is already call and returns.
17
  if (!class_exists('WP_Optimize')) :
18
+ define('WPO_VERSION', '2.2.9');
19
  define('WPO_PLUGIN_URL', plugin_dir_url(__FILE__));
20
  define('WPO_PLUGIN_MAIN_PATH', plugin_dir_path(__FILE__));
21
  define('WPO_PREMIUM_NOTIFICATION', false);
449
 
450
  $result = json_encode($results);
451
 
452
+ // Requires PHP 5.3+
453
+ // @codingStandardsIgnoreLine
454
+ $json_last_error = function_exists('json_last_error') ? json_last_error() : false;
455
 
456
  // if json_encode returned error then return error.
457
  if ($json_last_error) {