63% wp-post-views-counter

Code Review | Wp Post Views Counter

WordPress plugin Wp Post Views Counter scored63%from 54 tests.

About plugin

  • Plugin page: wp-post-views-cou...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.0
  • WordPress version: 6.3.1
  • First release: Jul 3, 2014
  • Latest release: Oct 22, 2014
  • Number of updates: 17
  • Update frequency: every 6.5 days
  • Top authors: ramandeep000 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

80+ active /7,243 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼1.67MB] [CPU: ▼44.68ms] Passed 4 tests

Analyzing server-side resources used by Wp Post Views Counter
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.32 ▼1.1411.97 ▼24.96
Dashboard /wp-admin2.33 ▼0.9712.71 ▼33.41
Posts /wp-admin/edit.php2.33 ▼1.0211.65 ▼35.28
Add New Post /wp-admin/post-new.php2.33 ▼3.5513.16 ▼85.08
Media Library /wp-admin/upload.php2.33 ▼0.9010.18 ▼22.61
Wp Post View Counter /wp-admin/options-general.php?page=wp-post-views-counter2.3312.01

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 31 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_views-widget
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Wp Post Views Counter
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲5513.65 ▼0.7313.77 ▲12.1342.49 ▼3.75
Dashboard /wp-admin2,092 ▼965.82 ▲0.7991.58 ▼13.3238.47 ▼3.28
Posts /wp-admin/edit.php2,137 ▲482.32 ▲0.2742.81 ▲2.0834.32 ▼0.06
Add New Post /wp-admin/post-new.php1,535 ▼723.10 ▲4.87613.88 ▼16.0139.45 ▼13.42
Media Library /wp-admin/upload.php1,411 ▲264.44 ▲0.20101.82 ▲2.8341.34 ▼3.25
Wp Post View Counter /wp-admin/options-general.php?page=wp-post-views-counter1,1982.7345.7642.67

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in TheaViews is deprecated since version 4.3.0! Use __construct() instead.
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_views-widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 25% 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)
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=wp-post-views-counter
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in TheaViews is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=wp-post-views-counter
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=wp-post-views-counter
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 8× 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/wp-post-views-counter/wp-post-views-counter.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/wp-post-views-counter/functions.php:8
    • > PHP Warning
      require(THEAPATH/admin/lib/counter.admin.class.php): failed to open stream: No such file or directory in wp-content/plugins/wp-post-views-counter/admin/wp-post-views-counter.admin.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-post-views-counter/admin/inc/widgets/widget-views.widget.php:5
    • > PHP Warning
      Use of undefined constant THEAPATH - assumed 'THEAPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-post-views-counter/admin/wp-post-views-counter.admin.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-post-views-counter/admin/inc/widget-views.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-post-views-counter/init.php:3
    • > PHP Fatal error
      require(): Failed opening required 'THEAPATH/admin/lib/counter.admin.class.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-post-views-counter/admin/wp-post-views-counter.admin.php on line 5

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=wp-post-views-counter
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
    • > GET request to /wp-admin/options-general.php?page=wp-post-views-counter
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
6 plugin tags: unique post count widget, count single post visits, wordpress post views counter, counter widget wordpress, post visitor count...

wp-post-views-counter/wp-post-views-counter.php Passed 13 tests

The main PHP file in "Wp Post Views Counter" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
106 characters long description:
WP Post Views Counter : Wordpress Post Views Coounter That tracks the post views when User visit your site

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
Success! There were no dangerous files found in this plugin1,173 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP9225124706
HTML120261
CSS72645155
JavaScript21023
JSON10016
SVG10012

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity11.20
▷ Minimum class complexity4.00
▷ Maximum class complexity28.00
Average method complexity1.88
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods58
▷ Static methods46.90%
▷ Public methods58100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
No PNG images were found in this plugin