94% count-cwp

Code Review | Count CWP

WordPress plugin Count CWP scored 94% from 54 tests.

About plugin

  • Plugin page: count-cwp
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.8
  • WordPress version: 5.8.1
  • First release: Sep 6, 2021
  • Latest release: Sep 7, 2021
  • Number of updates: 9
  • Update frequency: every 0.3 days
  • Top authors: Yiannistaos (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active / 115 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

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

A check of server-side resources used by Count CWP
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.94 ▲0.1135.49 ▲0.83
Dashboard /wp-admin3.18 ▲0.1348.96 ▲4.60
Posts /wp-admin/edit.php3.30 ▲0.1945.46 ▼2.42
Add New Post /wp-admin/post-new.php5.54 ▲0.1190.24 ▼569.06
Media Library /wp-admin/upload.php3.13 ▲0.1335.23 ▲4.04
Count CWP /wp-admin/options-general.php?page=count-cwp3.1026.27

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 33 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Count CWP
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲13615.89 ▼0.1511.52 ▲0.6745.55 ▼3.94
Dashboard /wp-admin2,972 ▲355.93 ▼0.03145.40 ▼7.50120.64 ▲8.86
Posts /wp-admin/edit.php2,797 ▲583.00 ▲0.2970.06 ▲4.6793.80 ▲6.73
Add New Post /wp-admin/post-new.php1,899 ▲28416.08 ▼5.43415.46 ▲130.99106.63 ▼3.11
Media Library /wp-admin/upload.php1,812 ▲55.05 ▲0.04159.44 ▲6.55119.53 ▲1.76
Count CWP /wp-admin/options-general.php?page=count-cwp1,2522.1855.8385.25

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

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
Even though everything seems fine, this is not 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 take a closer look at the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/count-cwp/includes/class-w357-count-cwp.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function status_header() in wp-content/plugins/count-cwp/uninstall.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/count-cwp/admin/settings-view.php:17

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 important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: characters, paragraphs, web357, count, words

count-cwp/count-cwp.php 92% from 13 tests

The main PHP script in "Count CWP" version 1.0.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 181 characters long)

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
Good job! No executable or dangerous file extensions detected784 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP15136542566
CSS4210114
PO File1233294
JavaScript421210

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity6.10
▷ Minimum class complexity1.00
▷ Maximum class complexity38.00
Average method complexity2.31
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods39
▷ Static methods25.13%
▷ Public methods3487.18%
▷ Protected methods00.00%
▷ Private methods512.82%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
2 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/web357-logo.png7.12KB2.83KB▼ 60.18%
admin/img/count-cwp-wordpress-plugin-120x200.png44.59KB9.90KB▼ 77.79%