84% booktrope-counter

Code Review | Booktrope - Counter

WordPress plugin Booktrope - Counter scored84%from 54 tests.

About plugin

  • Plugin page: booktrope-counter
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.5.2
  • WordPress version: 6.3.1
  • First release: Oct 19, 2013
  • Latest release: Oct 19, 2013
  • Number of updates: 7
  • Update frequency: every 1.9 days
  • Top authors: blahblahyaya (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /3,006 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.75ms] Passed 4 tests

A check of server-side resources used by Booktrope - Counter
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.01 ▼1.34
Dashboard /wp-admin3.31 ▲0.0151.68 ▼0.19
Posts /wp-admin/edit.php3.36 ▲0.0149.04 ▼0.97
Add New Post /wp-admin/post-new.php5.89 ▲0.0185.21 ▼20.48
Media Library /wp-admin/upload.php3.24 ▲0.0140.09 ▲2.68

Server storage [IO: ▲0.28MB] [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: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Booktrope - Counter: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.67 ▼0.582.09 ▲0.5143.16 ▲3.13
Dashboard /wp-admin2,206 ▲185.91 ▲0.8999.99 ▼10.4641.33 ▼2.87
Posts /wp-admin/edit.php2,089 ▼02.01 ▲0.0140.35 ▲4.0135.36 ▲0.24
Add New Post /wp-admin/post-new.php1,530 ▼1423.11 ▲4.62656.27 ▲27.5660.09 ▲4.91
Media Library /wp-admin/upload.php1,388 ▼04.13 ▼0.07108.73 ▼0.9644.81 ▼1.68

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× 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/booktrope-counter/main.php:52

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: Screenshot #1 (Booktrope Apple Style Counter in action) image required
The official readme.txt is a good inspiration

booktrope-counter/main.php 92% from 13 tests

This is the main PHP file of "Booktrope - Counter" version 0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("booktrope-counter.php" instead of "main.php")

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 plugin352 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript250101303
PHP151637
CSS16612

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.05
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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
4 PNG files occupy 0.26MB with 0.04MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png220.18KB76.62KB▼ 65.20%
img/digits.png23.68KB23.30KB▼ 1.60%
img/digits-bottom.png14.63KB14.59KB0.23%
img/digits-top.png7.61KB7.57KB0.46%