84% casia-counter-number

Code Review | Casia Counter Number

WordPress plugin Casia Counter Number scored84%from 54 tests.

About plugin

  • Plugin page: casia-counter-number
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.1
  • WordPress version: 6.3.1
  • First release: Jul 5, 2019
  • Latest release: Jul 6, 2019
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: castellar120 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /454 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.61MB] [CPU: ▲2.66ms] Passed 4 tests

A check of server-side resources used by Casia Counter Number
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.84 ▲0.3843.50 ▲1.90
Dashboard /wp-admin4.00 ▲0.6957.93 ▲7.27
Posts /wp-admin/edit.php4.09 ▲0.7360.72 ▲13.57
Add New Post /wp-admin/post-new.php6.57 ▲0.6991.10 ▼10.23
Media Library /wp-admin/upload.php3.90 ▲0.6743.59 ▲11.71
Add New /wp-admin/post-new.php?post_type=cascn_count_section4.3253.84
All Items /wp-admin/edit.php?post_type=cascn_count_section3.9750.46

Server storage [IO: ▲3.03MB] [DB: ▲0.09MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 460 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Casia Counter Number
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,969 ▲22314.53 ▲0.172.04 ▲0.2942.19 ▲1.90
Dashboard /wp-admin2,373 ▲1966.25 ▲0.58122.24 ▲4.9139.44 ▼19.02
Posts /wp-admin/edit.php2,298 ▲2013.35 ▲1.3353.00 ▲13.0930.88 ▼5.87
Add New Post /wp-admin/post-new.php1,556 ▲3023.53 ▼0.18696.16 ▲73.8037.17 ▼22.20
Media Library /wp-admin/upload.php3,924 ▲2,5245.89 ▲1.80159.79 ▲45.9259.67 ▲14.17
Add New /wp-admin/post-new.php?post_type=cascn_count_section1,8603.7071.2334.59
All Items /wp-admin/edit.php?post_type=cascn_count_section1,2823.3349.9329.20

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 38× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/casia-counter-number/cmb2/includes/types/CMB2_Type_Text_Datetime_Timestamp.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/casia-counter-number/cmb2/includes/types/CMB2_Type_Picker_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/casia-counter-number/cmb2/includes/rest-api/CMB2_REST.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/casia-counter-number/cmb2/includes/types/CMB2_Type_Textarea_Code.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/casia-counter-number/cmb2/includes/CMB2_hookup.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/casia-counter-number/cmb2/includes/types/CMB2_Type_Textarea.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller_Boxes' not found in wp-content/plugins/casia-counter-number/cmb2/includes/rest-api/CMB2_REST_Controller_Fields.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cmb2_dir() in wp-content/plugins/casia-counter-number/cmb2/includes/rest-api/CMB2_REST_Controller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/casia-counter-number/cmb2/includes/types/CMB2_Type_Taxonomy_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Select' not found in wp-content/plugins/casia-counter-number/cmb2/includes/types/CMB2_Type_Select_Timezone.php:13

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

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
No plugin tags provided

casia-counter-number/casia-counter-number.php 92% from 13 tests

The main PHP script in "Casia Counter Number" version 1.1 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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 plugin51,070 lines of code in 215 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP552,0866,2017,135
CSS131,1711,1484,694
JSON2003,529
Sass16300251,379
JavaScript63264991,376
Markdown22150633
SVG1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity18.67
▷ Minimum class complexity1.00
▷ Maximum class complexity185.00
Average method complexity3.26
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes66
▷ Abstract classes812.12%
▷ Concrete classes5887.88%
▷ Final classes00.00%
Methods519
▷ Static methods8616.57%
▷ Public methods42882.47%
▷ Protected methods8816.96%
▷ Private methods30.58%
Functions45
▷ Named functions45100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants333.33%
▷ Class constants666.67%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
114 compressed PNG files occupy 0.14MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/streamline/64/185081 - speech streamline talk user.png1.38KB1.58KB0.00%
cmb2/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
img/streamline/64/185094 - settings streamline.png1.30KB1.27KB▼ 2.54%
img/streamline/64/185078 - email mail streamline.png0.97KB1.11KB0.00%
img/streamline/64/185020 - macintosh.png1.02KB0.96KB▼ 6.14%