84% post-word-counter

Code Review | Post Word Counter

WordPress plugin Post Word Counter scored84%from 54 tests.

About plugin

  • Plugin page: post-word-counter
  • Plugin version: 1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Nov 18, 2022
  • Latest release: Nov 20, 2022
  • Number of updates: 7
  • Update frequency: every 0.3 days
  • Top authors: mrinal013 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /154 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.22MB] [CPU: ▼9.21ms] Passed 4 tests

Server-side resources used by Post Word Counter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1837.63 ▼3.08
Dashboard /wp-admin3.59 ▲0.2546.38 ▼16.93
Posts /wp-admin/edit.php3.64 ▲0.2946.86 ▼1.21
Add New Post /wp-admin/post-new.php6.11 ▲0.2384.52 ▼14.11
Media Library /wp-admin/upload.php3.45 ▲0.2334.54 ▼2.71
Post Word Counter /wp-admin/options-general.php?page=pwc_settings_page3.4333.12

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 44 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Post Word Counter
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.15 ▼1.221.71 ▼0.1836.76 ▼4.76
Dashboard /wp-admin2,207 ▲154.84 ▼0.10105.21 ▼3.1438.92 ▼6.00
Posts /wp-admin/edit.php2,090 ▲11.98 ▲0.0139.08 ▲4.0335.16 ▲3.44
Add New Post /wp-admin/post-new.php1,517 ▲317.67 ▲0.23639.53 ▼48.1849.86 ▼14.22
Media Library /wp-admin/upload.php1,389 ▲44.29 ▲0.0294.84 ▼27.2442.24 ▼6.84
Post Word Counter /wp-admin/options-general.php?page=pwc_settings_page9522.1822.3127.01

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 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
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Trait 'PostWordCounter\\Admin\\Submenu' not found in wp-content/plugins/post-word-counter/admin/Admin.php on line 20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

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
2 plugin tags: reading time counter, word counter

post-word-counter/post-word-counter.php 92% from 13 tests

The main file in "Post Word Counter" v. 1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • 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
No dangerous file extensions were detected4,300 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript52,0462,8233,325
PHP19237711912
JSON30058
Sass2003
CSS1202

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity6.75
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.11
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits2
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods63
▷ Static methods69.52%
▷ Public methods5790.48%
▷ Protected methods00.00%
▷ Private methods69.52%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.00%
Constants4
▷ Global constants4100.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
There are no PNG files in this plugin