82% opcache-scripts

Code Review | OPCache Scripts

WordPress plugin OPCache Scripts scored82%from 54 tests.

About plugin

  • Plugin page: opcache-scripts
  • Plugin version: 1.1.6
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.2
  • WordPress version: 6.3.1
  • First release: Jul 7, 2016
  • Latest release: Jul 21, 2023
  • Number of updates: 28
  • Update frequency: every 91.8 days
  • Top authors: nikdow (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /2,444 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲4.28MB] [CPU: ▲10.91ms] 75% from 4 tests

Server-side resources used by OPCache Scripts
Please have a look at the following items
  • RAM: Try to keep total memory usage under 10MB (currently 14.54MB on /wp-admin/tools.php?page=opcache)
PageMemory (MB)CPU Time (ms)
Home /7.74 ▲4.2755.85 ▲14.45
Dashboard /wp-admin7.58 ▲4.2865.74 ▲15.31
Posts /wp-admin/edit.php7.70 ▲4.3459.76 ▲11.49
Add New Post /wp-admin/post-new.php10.16 ▲4.28106.94 ▲2.40
Media Library /wp-admin/upload.php7.51 ▲4.2856.30 ▲16.63
OPCache /wp-admin/tools.php?page=opcache14.54114.46

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics 75% from 4 tests

An overview of browser requirements for OPCache Scripts
You may want to improve the following
  • Nodes: Limit the number of DOM nodes under 25,000 (currently 89,140 on /wp-admin/tools.php?page=opcache)
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.77 ▲0.421.71 ▲0.0940.68 ▼4.99
Dashboard /wp-admin2,199 ▲195.63 ▼0.0485.26 ▼4.9138.68 ▼3.92
Posts /wp-admin/edit.php2,104 ▲11.99 ▼0.0034.09 ▼4.5434.48 ▼2.60
Add New Post /wp-admin/post-new.php1,529 ▲322.99 ▼0.23597.75 ▼79.6758.36 ▲1.39
Media Library /wp-admin/upload.php1,401 ▲14.28 ▲0.0498.44 ▼5.1043.38 ▼5.05
OPCache /wp-admin/tools.php?page=opcache89,1404.96211.24370.41

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/opcache-scripts/opcache.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add an image for screenshot #1 (OPCache configuration settings)
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
  • Screenshots: No descriptions were found for these screenshots #0, #0, #0, #0 in opcache-scripts/assets to your readme.txt
The official readme.txt is a good inspiration

opcache-scripts/opcache.php 92% from 13 tests

"OPCache Scripts" version 1.1.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("opcache-scripts.php" instead of "opcache.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected728 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP110713487
Sass1280134
CSS111103
JavaScript1004

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity46.00
▷ Minimum class complexity46.00
▷ Maximum class complexity46.00
Average method complexity2.88
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods24
▷ Static methods00.00%
▷ Public methods2083.33%
▷ Protected methods00.00%
▷ Private methods416.67%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin