78% cnr-performance

Code Review | CNR Performance

WordPress plugin CNR Performance scored78%from 54 tests.

About plugin

  • Plugin page: cnr-performance
  • Plugin version: 0.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.5.3
  • WordPress version: 6.3.1
  • First release: Jul 11, 2016
  • Latest release: Jul 7, 2016
  • Number of updates: 2
  • Update frequency: every 1.5 days
  • Top authors: digisphere (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /814 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
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼6.05ms] Passed 4 tests

A check of server-side resources used by CNR Performance
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.88 ▼2.55
Dashboard /wp-admin3.33 ▲0.0349.18 ▼5.55
Posts /wp-admin/edit.php3.39 ▲0.0348.79 ▲1.38
Add New Post /wp-admin/post-new.php5.92 ▲0.0386.80 ▼15.70
Media Library /wp-admin/upload.php3.26 ▲0.0336.76 ▼0.40
CNR Performance /wp-admin/options-general.php?page=cnr-performance-settings3.2532.42

Server storage [IO: ▲0.03MB] [DB: ▲0.07MB] 67% from 3 tests

Filesystem and database footprint
It is recommended to fix the following issues
  • You have illegally modified 1 file (0.79KB) outside of "wp-content/plugins/cnr-performance/" and "wp-content/uploads/"
    • (modified) .htaccess
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for CNR Performance
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,769 ▲814.24 ▼0.381.72 ▲0.0440.71 ▼2.03
Dashboard /wp-admin2,201 ▲215.57 ▼0.0789.28 ▼10.0341.25 ▼0.43
Posts /wp-admin/edit.php2,106 ▲61.97 ▲0.0238.40 ▲3.5336.66 ▼0.61
Add New Post /wp-admin/post-new.php1,533 ▲523.23 ▲0.19683.67 ▲50.5152.96 ▼5.62
Media Library /wp-admin/upload.php1,409 ▲64.20 ▲0.0196.53 ▲1.4945.13 ▲2.40
CNR Performance /wp-admin/options-general.php?page=cnr-performance-settings9152.0029.6143.57

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=cnr-performance-settings
    • > Notice in wp-content/plugins/cnr-performance/lib/panel.php+347
    Trying to access array offset on value of type bool

SRP 50% 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
Almost there! Just fix the following items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/cnr-performance/lib/panel.php:449
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cnr-performance/lib/core-wp.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cnr-performance/lib/compress-html.php:135
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/cnr-performance/lib/panel.php:449

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
2 plugin tags: security, performance

cnr-performance/cnr-performance.php 92% from 13 tests

The main PHP file in "CNR Performance" ver. 0.0.1 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin674 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP512770621
Sass15028
CSS13019
Ruby16136

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity33.00
▷ Minimum class complexity20.00
▷ Maximum class complexity46.00
Average method complexity2.94
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods33
▷ Static methods00.00%
▷ Public methods3090.91%
▷ Protected methods39.09%
▷ Private methods00.00%
Functions13
▷ Named functions1184.62%
▷ Anonymous functions215.38%
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
PNG images were not found in this plugin