84% cp-blocks

Code Review | CP Blocks

WordPress plugin CP Blocks scored 84% from 54 tests.

About plugin

  • Plugin page: cp-blocks
  • Plugin version: 1.0.22
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.5-6.3
  • WordPress version: 6.3.1
  • First release: Aug 30, 2017
  • Latest release: Jul 23, 2023
  • Number of updates: 39
  • Update frequency: every 55.2 days
  • Top authors: codepeople (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

1,000+ active / 26,024 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼3.49ms] Passed 4 tests

Analyzing server-side resources used by CP Blocks
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1039.45 ▼7.35
Dashboard /wp-admin3.49 ▲0.18631.91 ▲581.73
Posts /wp-admin/edit.php3.52 ▲0.1649.48 ▲0.21
Add New Post /wp-admin/post-new.php6.01 ▲0.1297.20 ▼5.21
Media Library /wp-admin/upload.php3.33 ▲0.1030.88 ▼1.62

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 7 new options
New WordPress options
installed_cp-blocks
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for CP Blocks
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲14813.57 ▼0.711.79 ▲0.1342.89 ▼3.93
Dashboard /wp-admin2,282 ▲945.81 ▲0.9396.91 ▼8.2540.37 ▼2.37
Posts /wp-admin/edit.php2,108 ▲192.00 ▼0.0539.40 ▼3.1736.75 ▲1.82
Add New Post /wp-admin/post-new.php6,433 ▲4,90021.23 ▼2.05893.40 ▲230.5352.30 ▼2.29
Media Library /wp-admin/upload.php1,398 ▲74.17 ▲0.0094.52 ▼5.0741.77 ▼4.56

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
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • installed_cp-blocks
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

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
Everything seems fine, however 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 fix the following items
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cp-blocks/banner.php:106
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cp-blocks/banner.php:106
    • > PHP Fatal error
      Uncaught Error: Class 'CP_MetaSystem_BaseClass' not found in wp-content/plugins/cp-blocks/cp-main-class.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/cp-blocks/admin-int-license.inc.php:3

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
8 plugin tags: blocks, code, design, button, donation...

cp-blocks/cp-blocks-plugin.php 92% from 13 tests

The entry point to "CP Blocks" version 1.0.22 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("cp-blocks.php" instead of "cp-blocks-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin1,122 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP79257665
JavaScript5236249
HTML110162
PO File1151546

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity16.00
▷ Minimum class complexity4.00
▷ Maximum class complexity33.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods30
▷ Static methods00.00%
▷ Public methods2996.67%
▷ Protected methods00.00%
▷ Private methods13.33%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin