78% opcache-manager

Code Review | OPcache Manager

WordPress plugin OPcache Manager scored78%from 54 tests.

About plugin

  • Plugin page: opcache-manager
  • Plugin version: 2.11.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4
  • WordPress version: 6.3.1
  • First release: Nov 20, 2019
  • Latest release: Oct 25, 2023
  • Number of updates: 26
  • Update frequency: every 55.2 days
  • Top authors: PierreLannoy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active /13,687 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.11MB] [CPU: ▼0.47ms] Passed 4 tests

Server-side resources used by OPcache Manager
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0940.72 ▲3.70
Dashboard /wp-admin3.41 ▲0.1148.86 ▼0.95
Posts /wp-admin/edit.php3.53 ▲0.1745.83 ▼0.30
Add New Post /wp-admin/post-new.php6.01 ▲0.1392.42 ▼4.34
Media Library /wp-admin/upload.php3.34 ▲0.1142.15 ▲9.18
Tools /wp-admin/admin.php?page=perfopsone-tools3.3133.41
OPcache Manager /wp-admin/admin.php?page=opcm-settings3.6641.40
OPcache /wp-admin/admin.php?page=opcm-viewer4.4243.14
Analytics /wp-admin/admin.php?page=perfopsone-analytics3.3134.88
OPcache /wp-admin/admin.php?page=opcm-tools4.3747.44
Control Center /wp-admin/admin.php?page=perfopsone-dashboard3.3535.16

Server storage [IO: ▲2.10MB] [DB: ▲0.08MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 460 new files
Database: 1 new table, 6 new options
New tables
wp_opcm_statistics
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for OPcache Manager
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,882 ▲12114.34 ▼0.001.88 ▲0.4147.34 ▲6.31
Dashboard /wp-admin2,267 ▲905.62 ▲0.0984.83 ▲1.5638.40 ▼1.85
Posts /wp-admin/edit.php2,168 ▲682.02 ▲0.0433.89 ▼7.6036.01 ▼2.91
Add New Post /wp-admin/post-new.php1,576 ▲4518.19 ▼5.03612.69 ▼37.3380.44 ▲25.12
Media Library /wp-admin/upload.php1,471 ▲714.22 ▲0.0297.79 ▼0.1642.47 ▼0.31
Tools /wp-admin/admin.php?page=perfopsone-tools9402.0024.8029.26
OPcache Manager /wp-admin/admin.php?page=opcm-settings1,0582.0526.1741.13
OPcache /wp-admin/admin.php?page=opcm-viewer4,1554.93164.2982.94
Analytics /wp-admin/admin.php?page=perfopsone-analytics9432.0022.7725.83
OPcache /wp-admin/admin.php?page=opcm-tools1,9872.2028.5938.89
Control Center /wp-admin/admin.php?page=perfopsone-dashboard1,1122.1425.0633.83

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • 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
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/opcache-manager/public/partials/opcache-manager-public-display.php
  • 34× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/opcache-manager/includes/libraries/psr/http-message/RequestInterface.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Client\\ClientExceptionInterface' not found in wp-content/plugins/opcache-manager/includes/libraries/psr/http-client/RequestExceptionInterface.php:14
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-load.php' (include_path='.:/usr/share/php') in wp-content/plugins/opcache-manager/perfopsone/class-installer.php on line 12
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerInterface' not found in wp-content/plugins/opcache-manager/includes/libraries/psr/log/AbstractLogger.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'cebe\\markdownparser\\Parser' not found in wp-content/plugins/opcache-manager/includes/libraries/markdown/MarkdownParser.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/opcache-manager/admin/partials/opcache-manager-admin-settings-main.php:14
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/opcache-manager/perfopsone/class-installer.php on line 12
    • > PHP Warning
      require_once(ABSPATHwp-load.php): failed to open stream: No such file or directory in wp-content/plugins/opcache-manager/perfopsone/class-installer.php on line 12
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/opcache-manager/includes/libraries/psr/http-message/ResponseInterface.php:20
    • > PHP Warning
      Use of undefined constant OPCM_VENDOR_DIR - assumed 'OPCM_VENDOR_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/opcache-manager/includes/libraries/class-libraries.php on line 64

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
5 plugin tags: monitor, cache, analytics, opcache, zend

opcache-manager/opcache-manager.php Passed 13 tests

The principal PHP file in "OPcache Manager" v. 2.11.0 is loaded by WordPress automatically on each request
73 characters long description:
OPcache statistics and management right in the WordPress admin dashboard.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin36,361 lines of code in 429 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript121,9232,30520,488
PHP1101,1506,7809,381
SVG285014,251
CSS1327521,822
Markdown71550366
JSON20053

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 133)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity17.34
▷ Minimum class complexity1.00
▷ Maximum class complexity264.00
Average method complexity3.97
▷ Minimum method complexity1.00
▷ Maximum method complexity133.00
Code structure
Namespaces15
Interfaces13
Traits15
Classes67
▷ Abstract classes22.99%
▷ Concrete classes6597.01%
▷ Final classes00.00%
Methods622
▷ Static methods21534.57%
▷ Public methods45573.15%
▷ Protected methods11017.68%
▷ Private methods579.16%
Functions17
▷ Named functions635.29%
▷ Anonymous functions1164.71%
Constants59
▷ Global constants4881.36%
▷ Class constants1118.64%
▷ Public constants11100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected