74% wp-api-stats

Code Review | API Stats

WordPress plugin API Stats scored74%from 54 tests.

About plugin

  • Plugin page: wp-api-stats
  • Plugin version: 1.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.4.1
  • WordPress version: 6.3.1
  • First release: Aug 14, 2019
  • Latest release: Nov 26, 2023
  • Number of updates: 19
  • Update frequency: every 82.6 days
  • Top authors: salar6990 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /1,608 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
This plugin's installer ran successfully

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

A check of server-side resources used by API Stats
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0632.44 ▼10.62
Dashboard /wp-admin3.36 ▲0.0541.50 ▼14.32
Posts /wp-admin/edit.php3.41 ▲0.0549.59 ▲6.38
Add New Post /wp-admin/post-new.php5.94 ▲0.0584.94 ▲0.84
Media Library /wp-admin/upload.php3.28 ▲0.0541.91 ▲10.84
API Stats /wp-admin/tools.php?page=api-stats3.3449.72

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 13 new files
Database: 1 new table, 7 new options
New tables
wp_sg_api_stats_events
New WordPress options
widget_recent-posts
theysaidso_admin_options
sg_api_stats_db_version
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for API Stats
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲4714.35 ▼0.361.78 ▲0.0835.68 ▼7.64
Dashboard /wp-admin2,199 ▲275.63 ▲0.0692.22 ▼17.0037.98 ▼8.15
Posts /wp-admin/edit.php2,104 ▲71.96 ▼0.1838.96 ▲2.6935.44 ▲1.65
Add New Post /wp-admin/post-new.php1,529 ▼023.40 ▲0.64672.02 ▲82.8355.79 ▼0.07
Media Library /wp-admin/upload.php1,404 ▲44.19 ▲0.0194.56 ▼2.9940.80 ▲1.30
API Stats /wp-admin/tools.php?page=api-stats8542.12209.8628.22

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_sg_api_stats_events
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • sg_api_stats_db_version
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

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 user-side errors
    • > GET request to /wp-admin/tools.php?page=api-stats
    • > Rendering (warning) in unknown
    /wp-admin/tools.php?page=api-stats 165 The specified value "2023-11-26 23:59:59" does not conform to the required format, "yyyy-MM-dd".

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
1 plugin tags: api rest-api statistics stats

wp-api-stats/wp-api-stats.php 85% from 13 tests

"API Stats" version 1.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin422 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP68639331
JavaScript20662
CSS23015
Sass13014

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity21.00
▷ Minimum class complexity21.00
▷ Maximum class complexity21.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods1191.67%
▷ Protected methods00.00%
▷ Private methods18.33%
Functions6
▷ Named functions6100.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
PNG images were not found in this plugin