74% wp-counter

Code Review | WP Counter

WordPress plugin WP Counter scored74%from 54 tests.

About plugin

  • Plugin page: wp-counter
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.2
  • WordPress version: 6.3.1
  • First release: Sep 8, 2015
  • Latest release: May 17, 2023
  • Number of updates: 10
  • Update frequency: every 280.9 days
  • Top authors: haruncpi (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

900+ active /13,793 total downloads

Benchmarks

Plugin footprint 65% 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.02MB] [CPU: ▼5.41ms] Passed 4 tests

This is a short check of server-side resources used by WP Counter
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0240.35 ▼9.61
Dashboard /wp-admin3.32 ▲0.0247.60 ▲0.02
Posts /wp-admin/edit.php3.37 ▲0.0145.92 ▼2.99
Add New Post /wp-admin/post-new.php5.92 ▲0.0386.59 ▼9.04
Media Library /wp-admin/upload.php3.24 ▲0.0137.69 ▲2.88

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 28 new files
Database: 1 new table, 6 new options
New tables
wp_l24bd_wpcounter_visitors
New WordPress options
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Counter
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,954 ▲18313.39 ▼0.992.06 ▼0.1944.85 ▲1.80
Dashboard /wp-admin2,358 ▲1705.17 ▼0.71116.76 ▲11.1741.92 ▲1.46
Posts /wp-admin/edit.php2,095 ▲62.24 ▲0.2233.86 ▼0.4232.26 ▼2.20
Add New Post /wp-admin/post-new.php1,520 ▲123.38 ▲0.27618.39 ▼37.2652.29 ▼2.96
Media Library /wp-admin/upload.php1,388 ▼04.31 ▲0.0893.60 ▼7.4940.21 ▼4.26

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie tables detected upon uninstall: 1 table
    • wp_l24bd_wpcounter_visitors
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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 take a closer look at the following
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-counter/inc/shortcode.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-counter/inc/dashboard-widget.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Haruncpi\\WpCounter\\DB' not found in wp-content/plugins/wp-counter/views/widgets/status-widget.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Haruncpi\\WpCounter\\DB' not found in wp-content/plugins/wp-counter/views/widgets/visitor-graph-widget.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-counter/inc/date-helper.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-counter/inc/date-helper.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wp-counter/views/shortcodes/wpcounter.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 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: counter, wordpress visitor counter

wp-counter/wp-counter.php 85% from 13 tests

The main file in "WP Counter" v. 1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Description: The description should be shorter than 140 characters (currently 166 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin1,105 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP232126691,093
JSON20012

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity9.82
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.64
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods60
▷ Static methods2236.67%
▷ Public methods5693.33%
▷ Protected methods00.00%
▷ Private methods46.67%
Functions12
▷ Named functions1191.67%
▷ Anonymous functions18.33%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected