84% word-count

Code Review | Word Count

WordPress plugin Word Count scored 84% from 54 tests.

About plugin

  • Plugin page: word-count
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9.3
  • WordPress version: 6.3.1
  • First release: Apr 16, 2022
  • Latest release: Apr 16, 2022
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: obeyda (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 431 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.06ms] Passed 4 tests

Server-side resources used by Word Count
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.54 ▼7.88
Dashboard /wp-admin3.33 ▲0.0344.92 ▼4.04
Posts /wp-admin/edit.php3.38 ▲0.0345.25 ▼0.23
Add New Post /wp-admin/post-new.php5.91 ▲0.0391.92 ▼8.09
Media Library /wp-admin/upload.php3.26 ▲0.0334.35 ▲3.08
Word Count /wp-admin/options-general.php?page=word-count-settings-page3.2330.87

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Word Count: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.31 ▼1.284.29 ▲2.4136.85 ▼6.32
Dashboard /wp-admin2,210 ▲225.86 ▲0.00100.16 ▼8.5041.82 ▼3.62
Posts /wp-admin/edit.php2,096 ▲72.06 ▲0.0440.57 ▲4.1634.39 ▲2.17
Add New Post /wp-admin/post-new.php1,536 ▲223.02 ▼0.17611.22 ▼33.9960.86 ▲12.90
Media Library /wp-admin/upload.php1,383 ▼54.17 ▼0.02102.23 ▲3.0044.32 ▼4.65
Word Count /wp-admin/options-general.php?page=word-count-settings-page8392.0624.9126.46

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/word-count/our_first_plugin_word_count.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% 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
2 plugin tags: post, post type

word-count/our_first_plugin_word_count.php 85% from 13 tests

The entry point to "Word Count" version 1.0 is a PHP file that has certain tags in its header comment area
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
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("word-count.php" instead of "our_first_plugin_word_count.php")

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
Everything looks great! No dangerous files found in this plugin90 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1291090

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity2.18
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin