78% simple-post-counter-display

Code Review | Display Simple Post View Count

WordPress plugin Display Simple Post View Count scored78%from 54 tests.

About plugin

  • Plugin page: simple-post-count...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.4
  • WordPress version: 6.3.1
  • First release: Apr 23, 2020
  • Latest release: Apr 30, 2020
  • Number of updates: 7
  • Update frequency: every 1.4 days
  • Top authors: ais262technolabs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /472 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 successfully, without throwing any errors or notices

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

An overview of server-side resources used by Display Simple Post View Count
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.45 ▼0.0224.97 ▼19.85
Dashboard /wp-admin3.26 ▼0.0535.54 ▼13.07
Posts /wp-admin/edit.php3.33 ▼0.0341.99 ▼7.92
Add New Post /wp-admin/post-new.php5.50 ▼0.3974.69 ▼33.36
Media Library /wp-admin/upload.php3.27 ▲0.0330.60 ▼6.00
SPCD Options /wp-admin/options-general.php?page=spcd-options3.2431.86

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 9 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
spcd_frontend_css
widget_spcd_widget
widget_theysaidso_widget
widget_recent-comments
db_upgraded
spcd_count_text

Browser metrics Passed 4 tests

A check of browser resources used by Display Simple Post View Count
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲3714.37 ▲0.011.78 ▼0.0542.72 ▼4.48
Dashboard /wp-admin2,195 ▲155.63 ▼0.0689.33 ▼2.1142.03 ▼1.50
Posts /wp-admin/edit.php2,106 ▲62.04 ▲0.0236.19 ▼1.4536.67 ▲2.58
Add New Post /wp-admin/post-new.php1,545 ▲1422.98 ▼0.22656.78 ▼33.6557.06 ▲5.80
Media Library /wp-admin/upload.php1,403 ▲34.20 ▼0.0499.98 ▼10.3344.65 ▼4.73
SPCD Options /wp-admin/options-general.php?page=spcd-options9222.1825.6426.65

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 9 options in the database
    • spcd_frontend_css
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • spcd_count_text
    • widget_spcd_widget
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=spcd-options
    • > Warning in wp-content/plugins/simple-post-counter-display/spcd-function.php+256
    session_start(): Cannot start session when headers already sent

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
Almost there! Just fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-post-counter-display/spcd-function.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/simple-post-counter-display/simple-post-counter-display.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed: The official readme.txt is a good inspiration

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

The principal PHP file in "Display Simple Post View Count" v. 1.0.0 is loaded by WordPress automatically on each request
37 characters long description:
A plugin to simple post count display

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin315 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP25548313
CSS1012

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.14MB with 0.07MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png33.78KB17.92KB▼ 46.94%
screenshot-4.png45.97KB22.83KB▼ 50.34%
screenshot-2.png33.42KB15.42KB▼ 53.86%
screenshot-3.png33.51KB15.57KB▼ 53.53%