77% post-views-for-wp

Code Review | Post Views for WP

WordPress plugin Post Views for WP scored77%from 54 tests.

About plugin

  • Plugin page: post-views-for-wp
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.6.1
  • WordPress version: 6.3.1
  • First release: Jan 20, 2021
  • Latest release: Feb 25, 2021
  • Number of updates: 8
  • Update frequency: every 4.5 days
  • Top authors: merajali294 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /486 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
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼5.19ms] Passed 4 tests

Analyzing server-side resources used by Post Views for WP
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0636.40 ▼0.06
Dashboard /wp-admin3.36 ▲0.0649.61 ▼0.42
Posts /wp-admin/edit.php3.41 ▲0.0645.89 ▼17.01
Add New Post /wp-admin/post-new.php5.94 ▲0.0589.02 ▼2.07
Media Library /wp-admin/upload.php3.28 ▲0.0536.55 ▼1.27
PostViews for WP /wp-admin/options-general.php?page=postview-settings3.2231.76

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Post Views for WP: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.63 ▼1.124.37 ▲2.7240.52 ▼3.59
Dashboard /wp-admin2,210 ▲194.85 ▼1.05107.04 ▲4.4641.61 ▼5.04
Posts /wp-admin/edit.php2,103 ▲111.98 ▼0.0238.01 ▼4.2836.07 ▲1.54
Add New Post /wp-admin/post-new.php1,550 ▲3618.34 ▲0.68590.55 ▼77.1466.44 ▲13.71
Media Library /wp-admin/upload.php1,392 ▲44.17 ▼0.0593.42 ▼17.3242.58 ▼5.48
PostViews for WP /wp-admin/options-general.php?page=postview-settings8072.0623.1421.82

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=postview-settings
    • > Notice in wp-content/plugins/post-views-for-wp/admin/postviews-admin-settings.php+102
    Trying to access array offset on value of type bool

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 fix the following items
  • 1× 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/post-views-for-wp/admin/postviews-admin-settings.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: postviews, pagecount, postcount

post-views-for-wp/postviews-for-wp.php 77% from 13 tests

"Post Views for WP" version 1.0.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("post-views-for-wp.php" instead of "postviews-for-wp.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 173 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin280 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP26422280

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.21
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%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 2.29MB with 1.39MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png66.70KB33.75KB▼ 49.40%
assets/screenshot-2.png1,104.33KB307.90KB▼ 72.12%
assets/post-views-admin-settings-area.png66.70KB33.75KB▼ 49.40%
assets/Postviews-output.png1,104.33KB307.90KB▼ 72.12%