84% cmc-role

Code Review | CMC ROLE

WordPress plugin CMC ROLE scored 84% from 54 tests.

About plugin

  • Plugin page: cmc-role
  • Plugin version: 0.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6.0-4.8
  • WordPress version: 6.3.1
  • First release: May 25, 2017
  • Latest release: May 25, 2017
  • Number of updates: 6
  • Update frequency: every 5.0 days
  • Top authors: lovnic (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 726 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.85ms] Passed 4 tests

A check of server-side resources used by CMC ROLE
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.44 ▼3.58
Dashboard /wp-admin3.32 ▲0.0143.94 ▼1.45
Posts /wp-admin/edit.php3.37 ▲0.0144.75 ▼4.05
Add New Post /wp-admin/post-new.php5.90 ▲0.0189.08 ▼2.32
Media Library /wp-admin/upload.php3.24 ▲0.0131.65 ▲0.63
CMC Role /wp-admin/users.php?page=cmcrm3.1326.29

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 62 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
cmc_role_settings
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for CMC ROLE
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.65 ▼0.594.16 ▲2.3737.63 ▼5.88
Dashboard /wp-admin2,210 ▲184.84 ▼0.06106.60 ▼1.8743.13 ▲4.63
Posts /wp-admin/edit.php2,096 ▲72.00 ▲0.0039.52 ▲1.2737.58 ▲5.51
Add New Post /wp-admin/post-new.php1,536 ▲223.30 ▲0.16619.61 ▼83.8451.98 ▼1.64
Media Library /wp-admin/upload.php1,392 ▲44.17 ▼0.01135.92 ▲31.2251.35 ▲6.66
CMC Role /wp-admin/users.php?page=cmcrm1,7181.8428.3032.50

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • cmc_role_settings
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/users.php?page=cmcrm
    • > Notice in wp-content/plugins/cmc-role/include/class-cmc-role-table.php+187
    Undefined index: action2
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/users.php?page=cmcrm
    • > Notice in wp-content/plugins/cmc-role/page/admin.php+66
    Undefined index: active
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/users.php?page=cmcrm
    • > Notice in wp-content/plugins/cmc-role/page/admin.php+67
    Undefined index: class
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/users.php?page=cmcrm
    • > Notice in wp-content/plugins/cmc-role/page/admin.php+68
    Undefined index: atts
    • > GET request to /wp-admin/users.php?page=cmcrm
    • > Notice in wp-content/plugins/cmc-role/include/class-cmc-role-table.php+123
    Undefined index: location
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/users.php?page=cmcrm
    • > Notice in wp-content/plugins/cmc-role/include/class-cmc-role-table.php+80
    Undefined variable: result

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Everything seems fine, however this is by no means an exhaustive test

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: Screenshot #4 (Settings) image required
The official readme.txt is a good inspiration

cmc-role/cmc-role.php 92% from 13 tests

The primary PHP file in "CMC ROLE" version 0.0.1 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • 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 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin11,972 lines of code in 48 files:
LanguageFilesBlank linesComment linesLines of code
CSS91031394,870
SVG1002,671
Sass1434341,768
LESS1434441,758
PHP8133196748
JavaScript21441157

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity40.00
▷ Minimum class complexity17.00
▷ Maximum class complexity63.00
Average method complexity2.46
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes150.00%
Methods44
▷ Static methods2863.64%
▷ Public methods3477.27%
▷ Protected methods49.09%
▷ Private methods613.64%
Functions12
▷ Named functions18.33%
▷ Anonymous functions1191.67%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/jquery-ui/images/ui-icons_777777_256x240.png6.83KB4.17KB▼ 38.92%
assets/css/jquery-ui/images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%
assets/css/jquery-ui/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
assets/css/jquery-ui/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%
assets/css/jquery-ui/images/ui-icons_555555_256x240.png6.82KB4.17KB▼ 38.82%