53% cmc-hook

Code Review | CMC Hook

WordPress plugin CMC Hook scored53%from 54 tests.

About plugin

  • Plugin page: cmc-hook
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6.0-4.8
  • WordPress version: 6.3.1
  • First release: Apr 26, 2017
  • Latest release: Jul 24, 2017
  • Number of updates: 34
  • Update frequency: every 2.6 days
  • Top authors: lovnic (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /993 total downloads

Benchmarks

Plugin footprint 30% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼1.55MB] [CPU: ▼53.42ms] Passed 4 tests

An overview of server-side resources used by CMC Hook
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2645.99 ▼1.97
Dashboard /wp-admin2.40 ▼0.949.68 ▼62.57
Posts /wp-admin/edit.php2.40 ▼0.9510.67 ▼42.61
Add New Post /wp-admin/post-new.php2.40 ▼3.4911.22 ▼81.74
Media Library /wp-admin/upload.php2.40 ▼0.839.76 ▼26.75
CMC Hook /wp-admin/tools.php?page=cmc-hook2.4210.63

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 250 new files
Database: 2 new tables, 7 new options
New tables
wp_cmc_hook
wp_cmc_hook_project
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
cmc_hook_settings
widget_recent-posts

Browser metrics Passed 4 tests

CMC Hook: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.21 ▼0.521.68 ▼0.2048.16 ▲7.40
Dashboard /wp-admin2,199 ▲225.62 ▲0.0889.56 ▼13.4739.00 ▼3.02
Posts /wp-admin/edit.php2,107 ▲71.99 ▲0.0639.27 ▲3.8941.22 ▲5.60
Add New Post /wp-admin/post-new.php1,538 ▲318.25 ▲0.29609.15 ▼65.8460.39 ▲3.37
Media Library /wp-admin/upload.php1,401 ▲14.21 ▲0.0194.84 ▼9.0040.99 ▼3.08
CMC Hook /wp-admin/tools.php?page=cmc-hook1,4083.2047.4528.86

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/cmc-hook/cmc_hook.php+88
    Undefined index: action2
  • The plugin did not uninstall correctly, leaving 250 files (2.65MB) in the plugin directory
    • (new file) assets/css/codemirror/theme/base16-dark.css
    • (new file) assets/css/codemirror/theme/3024-day.css
    • (new file) assets/css/codemirror/theme/base16-light.css
    • (new file) assets/css/codemirror/codemirror.css
    • (new file) assets/css/codemirror/theme/3024-night.css
    • (new file) assets/css/codemirror/theme/blackboard.css
    • (new file) assets/css/codemirror/theme/ambiance-mobile.css
    • (new file) assets/css/codemirror/theme/abcdef.css
    • (new file) assets/css/codemirror/theme/ambiance.css
    • (new file) assets/css/codemirror/theme/bespin.css
    • ...
  • Zombie tables were found after uninstall: 2 tables
    • wp_cmc_hook_project
    • wp_cmc_hook
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-comments
    • cmc_hook_settings
    • widget_theysaidso_widget
    • db_upgraded
    • recovery_mode_email_last_sent
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=cmc-hook
    • > Notice in wp-content/plugins/cmc-hook/include/class-cmc-hook-table.php+303
    Undefined index: action2
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=cmc-hook
    • > Notice in wp-content/plugins/cmc-hook/cmc_hook.php+93
    Undefined index: cmchk_action
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=cmc-hook
    • > Notice in wp-content/plugins/cmc-hook/include/class-cmc-hook-table.php+210
    Undefined index: tab
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=cmc-hook
    • > Notice in wp-content/plugins/cmc-hook/pages/admin.php+113
    Undefined index: active
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=cmc-hook
    • > Notice in wp-content/plugins/cmc-hook/pages/admin.php+114
    Undefined index: class
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=cmc-hook
    • > Notice in wp-content/plugins/cmc-hook/pages/admin.php+115
    Undefined index: atts
    • > GET request to /wp-admin/tools.php?page=cmc-hook
    • > Notice in wp-content/plugins/cmc-hook/pages/admin.php+121
    Undefined index: section
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=cmc-hook
    • > Notice in wp-content/plugins/cmc-hook/include/class-cmc-hook-table.php+207
    Undefined index: id
    • > GET request to /wp-admin/tools.php?page=cmc-hook
    • > Notice in wp-content/plugins/cmc-hook/include/class-cmc-hook-table.php+80
    Undefined index: cmchk_status
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=cmc-hook
    • > Notice in wp-content/plugins/cmc-hook/include/class-cmc-hook-table.php+208
    Undefined index: status

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
The official readme.txt might help

cmc-hook/cmc_hook.php 85% from 13 tests

The main PHP script in "CMC Hook" version 1.0.6 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("cmc-hook.php" instead of "cmc_hook.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin36,459 lines of code in 198 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript662,1742,20717,741
CSS675064047,392
PHP233774532,755
SVG1002,671
HTML1226411,821
Sass1434341,768
LESS1434441,758
Markdown11250553

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity41.00
▷ Minimum class complexity16.00
▷ Maximum class complexity74.00
Average method complexity3.78
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes112.50%
Methods102
▷ Static methods6967.65%
▷ Public methods9795.10%
▷ Protected methods21.96%
▷ Private methods32.94%
Functions17
▷ Named functions529.41%
▷ Anonymous functions1270.59%
Constants13
▷ Global constants13100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
40 compressed PNG files occupy 0.09MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/js/jqueryFileTree/images/linux.png0.65KB0.65KB0.00%
assets/js/jqueryFileTree/images/ruby.png0.61KB0.65KB0.00%
assets/css/codemirror/ui/images/silk/page_save.png0.76KB0.99KB0.00%
assets/js/jqueryFileTree/images/film.png0.64KB0.75KB0.00%
assets/js/jqueryFileTree/images/xls.png0.65KB0.63KB▼ 2.41%