84% abwp-simple-counter

Code Review | Simple Counter

WordPress plugin Simple Counter scored84%from 54 tests.

About plugin

  • Plugin page: abwp-simple-counter
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-6.2.2
  • WordPress version: 6.3.1
  • First release: Mar 25, 2019
  • Latest release: May 22, 2023
  • Number of updates: 17
  • Update frequency: every 89.5 days
  • Top authors: abwp (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /6,788 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.04MB] [CPU: ▼6.11ms] Passed 4 tests

Server-side resources used by Simple Counter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0342.61 ▼0.23
Dashboard /wp-admin3.34 ▲0.0448.98 ▼8.23
Posts /wp-admin/edit.php3.39 ▲0.0449.94 ▼0.00
Add New Post /wp-admin/post-new.php5.92 ▲0.0479.07 ▼15.96
Media Library /wp-admin/upload.php3.27 ▲0.0435.44 ▲0.23
Simple Counter /wp-admin/options-general.php?page=simple-counter3.2932.68

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Simple Counter
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3313.29 ▼1.134.65 ▲2.5943.72 ▼0.15
Dashboard /wp-admin2,207 ▲195.84 ▲0.99100.51 ▼17.8338.70 ▼5.34
Posts /wp-admin/edit.php2,093 ▲41.99 ▼0.0238.35 ▲1.7834.70 ▲1.45
Add New Post /wp-admin/post-new.php1,539 ▲2023.23 ▲0.10605.27 ▼96.6962.25 ▼10.47
Media Library /wp-admin/upload.php1,392 ▲44.18 ▼0.05103.33 ▼7.3640.88 ▼6.89
Simple Counter /wp-admin/options-general.php?page=simple-counter9762.0623.9643.73

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_admin_page_title() in wp-content/plugins/abwp-simple-counter/includes/page-admin-counters.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/abwp-simple-counter/simple-counter.php:21

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 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
7 plugin tags: tools, google, statistics, yandex, analytics...

abwp-simple-counter/simple-counter.php 92% from 13 tests

Analyzing the main PHP file in "Simple Counter" version 1.0.2
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("abwp-simple-counter.php" instead of "simple-counter.php")

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
Success! There were no dangerous files found in this plugin373 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP32513275
PO File1293198

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity14.00
▷ Minimum class complexity2.00
▷ Maximum class complexity26.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods1184.62%
▷ Protected methods00.00%
▷ Private methods215.38%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin