84% post-display-counter

Code Review | Post Display Counter

WordPress plugin Post Display Counter scored84%from 54 tests.

About plugin

  • Plugin page: post-display-counter
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-3.9
  • WordPress version: 6.3.1
  • First release: Aug 9, 2014
  • Latest release: Aug 11, 2014
  • Number of updates: 3
  • Update frequency: every 1.0 days
  • Top authors: carloroosen (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active /1,327 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.30MB] [CPU: ▼20.77ms] Passed 4 tests

A check of server-side resources used by Post Display Counter
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0133.76 ▼7.35
Dashboard /wp-admin3.35 ▲0.0149.65 ▼14.24
Posts /wp-admin/edit.php3.40 ▲0.0550.54 ▲2.72
Add New Post /wp-admin/post-new.php4.64 ▼1.2444.74 ▼58.92
Media Library /wp-admin/upload.php3.27 ▲0.0535.22 ▼2.58
Post Display Counter /wp-admin/plugins.php?page=post-display-counter3.2533.47

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Post Display Counter
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,983 ▲22213.43 ▼0.9412.31 ▲10.5342.31 ▲1.62
Dashboard /wp-admin2,199 ▲255.68 ▲0.0886.39 ▼7.3637.85 ▼4.99
Posts /wp-admin/edit.php2,107 ▲102.01 ▲0.0240.10 ▲0.7539.07 ▲1.95
Add New Post /wp-admin/post-new.php6,239 ▲4,71121.01 ▼2.28897.33 ▲204.8675.24 ▲19.45
Media Library /wp-admin/upload.php1,404 ▲14.18 ▼0.01104.58 ▼13.5845.09 ▼1.18
Post Display Counter /wp-admin/plugins.php?page=post-display-counter8571.9026.4326.25

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means 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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/post-display-counter/post-display-counter.php:10

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 Passed 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: clickthrough rate, count views

post-display-counter/post-display-counter.php Passed 13 tests

This is the main PHP file of "Post Display Counter" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
74 characters long description:
Show a counter above each post with number of displays and number of views

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin1,210 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
CSS1162160957
PHP1439195
JavaScript113258

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin