83% wp-word-count

Code Review | WP Word Count

WordPress plugin WP Word Count scored 83% from 54 tests.

About plugin

  • Plugin page: wp-word-count
  • Plugin version: 3.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8.1
  • WordPress version: 5.9.2
  • First release: Aug 18, 2010
  • Latest release: Oct 7, 2021
  • Number of updates: 76
  • Update frequency: every 53.5 days
  • Top authors: linksoftware (64.47%)bjplink (32.89%)redlettuce (5.26%)

Code review

54 tests

User reviews

12 reviews

Install metrics

10,000+ active / 134,128 total downloads

Benchmarks

Plugin footprint Passed 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.17MB] [CPU: ▼313.63ms] Passed 4 tests

Analyzing server-side resources used by WP Word Count
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1143.57 ▼8.53
Dashboard /wp-admin3.60 ▲0.2039.10 ▲6.86
Posts /wp-admin/edit.php3.83 ▲0.1937.94 ▼3.49
Add New Post /wp-admin/post-new.php5.81 ▼1.1658.73 ▼1,243.37
Media Library /wp-admin/upload.php3.48 ▲0.1926.06 ▲0.87
Statistics /wp-admin/admin.php?page=wp-word-count3.4323.79
Upgrade to Pro /wp-admin/admin.php?page=wp-word-count-upgrade3.4723.99
Calculate /wp-admin/admin.php?page=wp-word-count-calculate3.4722.96
Reading Time /wp-admin/admin.php?page=wp-word-count-reading-time3.4624.43

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 33 new files
Database: 1 new table, 1 new option
New tables
wp_wpwc_posts
New WordPress options
wpwc_version

Browser metrics Passed 4 tests

A check of browser resources used by WP Word Count
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,822 ▲10016.24 ▲0.235.68 ▼0.142.29 ▼0.10
Dashboard /wp-admin2,945 ▲876.33 ▲0.08121.86 ▼17.52155.81 ▼13.35
Posts /wp-admin/edit.php2,746 ▲523.28 ▲0.0364.82 ▲0.79143.31 ▼5.52
Add New Post /wp-admin/post-new.php1,701 ▲4016.12 ▼5.44428.80 ▲4.53159.23 ▲2.69
Media Library /wp-admin/upload.php1,749 ▲545.66 ▲0.13146.20 ▲7.43194.21 ▲9.29
Statistics /wp-admin/admin.php?page=wp-word-count1,0452.8356.47102.45
Upgrade to Pro /wp-admin/admin.php?page=wp-word-count-upgrade1,1762.7855.85169.68
Calculate /wp-admin/admin.php?page=wp-word-count-calculate1,1982.8757.70140.96
Reading Time /wp-admin/admin.php?page=wp-word-count-reading-time1,1372.8656.15152.80

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-word-count-reading-time
    • > Notice in wp-content/plugins/wp-word-count/admin/class-wpwc-admin.php+205
    Trying to access array offset on value of type bool
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-word-count-reading-time
    • > Notice in wp-content/plugins/wp-word-count/admin/class-wpwc-admin.php+205
    Trying to access array offset on value of type null

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-word-count/admin/partials/wpwc-footer.php
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_query_arg() in wp-content/plugins/wp-word-count/admin/partials/wpwc-statistics-menu.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-word-count/admin/partials/wpwc-upgrade.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-word-count/admin/partials/wpwc-statistics.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-word-count/admin/partials/wpwc-reading-time.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-word-count/admin/partials/wpwc-statistics-totals.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-word-count/admin/partials/wpwc-calculate.php:18

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 undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: reading time, authors, words, word count, writing

wp-word-count/wpwordcount.php 92% from 13 tests

The main PHP script in "WP Word Count" version 3.2.3 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-word-count.php" instead of "wpwordcount.php")

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
Success! There were no dangerous files found in this plugin1,403 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP183045811,096
PO File14781162
JavaScript151279
CSS121066

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity12.00
▷ Minimum class complexity1.00
▷ Maximum class complexity68.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods44
▷ Static methods24.55%
▷ Public methods3988.64%
▷ Protected methods00.00%
▷ Private methods511.36%
Functions11
▷ Named functions981.82%
▷ Anonymous functions218.18%
Constants1
▷ Global constants1100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/images/linksoftware.png1.37KB0.68KB▼ 50.75%