10% easy-object-cache

Code Review | Easy Object Cache

WordPress plugin Easy Object Cache scored10%from 54 tests.

About plugin

  • Plugin page: easy-object-cache
  • Plugin version: 1.30
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.8
  • WordPress version: 6.3.1
  • First release: Feb 15, 2016
  • Latest release: Aug 1, 2017
  • Number of updates: 13
  • Update frequency: every 41.2 days
  • Top authors: manojtd (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active /1,680 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/easy-object-cache/EzOptions.php+21
    Methods with the same name as their class will not be constructors in a future version of PHP; EzBaseOption has a deprecated constructor

Server metrics [RAM: ▼1.71MB] [CPU: ▼50.46ms] Passed 4 tests

Server-side resources used by Easy Object Cache
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.27 ▼1.195.88 ▼31.65
Dashboard /wp-admin2.29 ▼1.016.71 ▼47.67
Posts /wp-admin/edit.php2.29 ▼1.068.28 ▼37.30
Add New Post /wp-admin/post-new.php2.29 ▼3.596.74 ▼85.20
Media Library /wp-admin/upload.php2.29 ▼0.947.10 ▼22.01

Server storage [IO: ▲0.57MB] [DB: ▲0.00MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Easy Object Cache
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.17 ▼1.214.96 ▲3.2441.14 ▼5.42
Dashboard /wp-admin2,210 ▲225.88 ▼0.0297.97 ▼10.7138.28 ▼6.92
Posts /wp-admin/edit.php2,093 ▲42.03 ▲0.0136.78 ▼2.3832.60 ▼2.04
Add New Post /wp-admin/post-new.php1,546 ▲1318.36 ▼4.91625.20 ▼62.9868.08 ▲5.54
Media Library /wp-admin/upload.php1,395 ▲104.20 ▼0.0495.78 ▼8.2142.02 ▼0.33
Easy Object Cache Lite /wp-admin/easy-object-cache.php260.440.0816.01

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/easy-object-cache/EzOptions.php+21
    Methods with the same name as their class will not be constructors in a future version of PHP; EzBaseOption has a deprecated constructor
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/file.php): failed to open stream: No such file or directory in wp-content/plugins/easy-object-cache/EzObjectCacheBase.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/easy-object-cache/info-divs.php:2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/easy-object-cache/EzObjectCacheBase.php on line 7
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/file.php): failed to open stream: No such file or directory in wp-content/plugins/easy-object-cache/EzObjectCacheBase.php on line 7
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/file.php' (include_path='.:/usr/share/php') in wp-content/plugins/easy-object-cache/EzObjectCacheBase.php on line 7
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/easy-object-cache/myPlugins.php:300
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/file.php' (include_path='.:/usr/share/php') in wp-content/plugins/easy-object-cache/EzObjectCacheBase.php on line 7
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/easy-object-cache/EzObjectCacheBase.php on line 7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/easy-object-cache.php
    • > Network (severe)
    wp-admin/easy-object-cache.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add an image for screenshot #1 (*Easy Object Cache* admin page.)
You can take inspiration from this readme.txt

easy-object-cache/easy-object-cache.php Passed 13 tests

The main file in "Easy Object Cache" v. 1.30 serves as a complement to information provided in readme.txt and as the entry point to the plugin
112 characters long description:
Easy Object Cache provides Alternate PHP Cache user data caching functions and lets you control WP object cache.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin3,386 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP73582752,270
JavaScript1511341,116

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity12.11
▷ Minimum class complexity1.00
▷ Maximum class complexity54.00
Average method complexity2.65
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes18
▷ Abstract classes00.00%
▷ Concrete classes18100.00%
▷ Final classes00.00%
Methods121
▷ Static methods64.96%
▷ Public methods11998.35%
▷ Protected methods00.00%
▷ Private methods21.65%
Functions34
▷ Named functions34100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.18MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/ezsupport.png3.13KB2.01KB▼ 35.75%
ezpaypal.png9.22KB3.44KB▼ 62.72%
img/ezpaypal.png9.22KB3.44KB▼ 62.72%
ezsupport.png3.13KB2.01KB▼ 35.75%
screenshot-1.png158.33KB39.94KB▼ 74.77%