74% site-analytics-widget

Code Review | Site Analytics Widget

WordPress plugin Site Analytics Widget scored74%from 54 tests.

About plugin

  • Plugin page: site-analytics-wi...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.8
  • WordPress version: 6.3.1
  • First release: Mar 2, 2014
  • Latest release: Mar 5, 2014
  • Number of updates: 5
  • Update frequency: every 0.6 days
  • Top authors: eflyjason (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,366 total downloads

Benchmarks

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

A check of server-side resources used by Site Analytics Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.30 ▼1.168.03 ▼33.44
Dashboard /wp-admin2.31 ▼0.9911.73 ▼37.67
Posts /wp-admin/edit.php2.31 ▼1.0412.65 ▼31.92
Add New Post /wp-admin/post-new.php2.31 ▼3.5710.21 ▼79.58
Media Library /wp-admin/upload.php2.31 ▼0.919.59 ▼25.94

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_site_analytics_widget
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Site Analytics Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.16 ▼1.191.60 ▼0.2942.62 ▼8.01
Dashboard /wp-admin2,206 ▲184.86 ▼0.00106.95 ▼7.5441.88 ▼4.74
Posts /wp-admin/edit.php2,092 ▲32.04 ▲0.0439.41 ▲3.8336.04 ▲0.81
Add New Post /wp-admin/post-new.php1,528 ▼518.38 ▼4.67611.68 ▼61.7858.89 ▲3.92
Media Library /wp-admin/upload.php1,382 ▼64.25 ▲0.0499.29 ▼10.8340.81 ▼7.52

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in site_analytics_widget is deprecated since version 4.3.0! Use __construct() instead.
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • widget_site_analytics_widget
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/site-analytics-widget/site-analytics-widget.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 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
4 plugin tags: widget, sidebar, site, analytics

site-analytics-widget/site-analytics-widget.php Passed 13 tests

The main PHP script in "Site Analytics Widget" version 1.0.1 is automatically included on every request by WordPress
93 characters long description:
Add a Widget of your Website's Analytics. 在網站上增加一個「網站統計」小工具

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin164 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PO File2222492
PHP1183472

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.05
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.40
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
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 images were found in this plugin