66% wp-one-metric

Code Review | WP One Metric

WordPress plugin WP One Metric scored66%from 54 tests.

About plugin

  • Plugin page: wp-one-metric
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.2
  • WordPress version: 6.3.1
  • First release: Feb 13, 2015
  • Latest release: May 31, 2015
  • Number of updates: 13
  • Update frequency: every 8.2 days
  • Top authors: horike (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,352 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.01MB] [CPU: ▲2.12ms] Passed 4 tests

An overview of server-side resources used by WP One Metric
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.44 ▲0.9842.67 ▲0.27
Dashboard /wp-admin4.33 ▲1.0255.22 ▲3.64
Posts /wp-admin/edit.php4.41 ▲1.0554.00 ▲5.82
Add New Post /wp-admin/post-new.php6.90 ▲1.0290.64 ▼1.25
Media Library /wp-admin/upload.php4.23 ▲1.0047.07 ▲6.67
Analytics設定 /wp-admin/options-general.php?page=gapiwp-analytics4.2039.09
WP One Metric /wp-admin/index.php?page=wpomc-dash4.1739.26

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 209 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

WP One Metric: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.33 ▼0.964.40 ▲2.5337.35 ▼11.15
Dashboard /wp-admin2,228 ▲395.05 ▲0.10105.69 ▼3.3746.79 ▲5.28
Posts /wp-admin/edit.php2,144 ▲552.61 ▲0.6038.49 ▼1.6141.01 ▲5.69
Add New Post /wp-admin/post-new.php1,537 ▼523.17 ▲5.09682.71 ▲39.1466.27 ▲16.55
Media Library /wp-admin/upload.php1,413 ▲224.47 ▲0.24111.31 ▼2.7251.89 ▲4.78
Analytics設定 /wp-admin/options-general.php?page=gapiwp-analytics8711.8527.4769.34
WP One Metric /wp-admin/index.php?page=wpomc-dash8652.4851.7245.51

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/index.php?page=wpomc-dash
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/index.php?page=wpomc-dash
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 9× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-one-metric/vendor/google/apiclient/examples/service-account.php
    • > /wp-content/plugins/wp-one-metric/vendor/google/apiclient/examples/fileupload.php
    • > /wp-content/plugins/wp-one-metric/vendor/google/apiclient/examples/user-example.php
    • > /wp-content/plugins/wp-one-metric/vendor/google/apiclient/examples/simple-query.php
    • > /wp-content/plugins/wp-one-metric/vendor/google/apiclient/examples/index.php
    • > /wp-content/plugins/wp-one-metric/vendor/google/apiclient/examples/multi-api.php
    • > /wp-content/plugins/wp-one-metric/vendor/google/apiclient/examples/batch.php
    • > /wp-content/plugins/wp-one-metric/vendor/google/apiclient/examples/simplefileupload.php
    • > /wp-content/plugins/wp-one-metric/vendor/google/apiclient/examples/idtoken.php
  • 113× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'BaseTest' not found in wp-content/plugins/wp-one-metric/vendor/google/apiclient/tests/general/IoTest.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/wp-one-metric/vendor/google/apiclient/src/Google/Service/Taskqueue.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/wp-one-metric/vendor/google/apiclient/src/Google/Service/Customsearch.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-one-metric/modules/main.php:289
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/wp-one-metric/vendor/google/apiclient/tests/general/ResourceTest.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/wp-one-metric/vendor/google/apiclient/src/Google/Service/SQLAdmin.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Hametuha\\GapiWP\\Service\\Prototype' not found in wp-content/plugins/wp-one-metric/vendor/hametuha/gapiwp/src/Hametuha/GapiWP/Service/Analytics.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/wp-one-metric/vendor/google/apiclient/src/Google/Service/AdSense.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/wp-one-metric/vendor/google/apiclient/src/Google/Service/Pagespeedonline.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/wp-one-metric/vendor/google/apiclient/src/Google/Service/Games.php:31

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=gapiwp-analytics
    • > Javascript (severe) in unknown
    http://cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js?ver=1.0 5:1339 Uncaught Error: Graph container element not found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: Please add an image for screenshot #1 (Vertical axis: evaluation indicator)
Please take inspiration from this readme.txt

wp-one-metric/wp-one-metric.php 92% from 13 tests

The primary PHP file in "WP One Metric" version 1.2 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 180 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin174,465 lines of code in 194 files:
LanguageFilesBlank linesComment linesLines of code
PHP17411,35733,188173,809
JSON700169
Markdown4740142
XML22841122
CSS2161584
PO File1162349
Sass11039
JavaScript16423
YAML16222
INI1016

PHP code Passed 2 tests

Analyzing 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.02
Average class complexity1.25
▷ Minimum class complexity1.00
▷ Maximum class complexity60.00
Average method complexity1.03
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces5
Interfaces1
Traits0
Classes3,052
▷ Abstract classes70.23%
▷ Concrete classes3,04599.77%
▷ Final classes00.00%
Methods23,893
▷ Static methods190.08%
▷ Public methods23,79399.58%
▷ Protected methods340.14%
▷ Private methods660.28%
Functions17
▷ Named functions1164.71%
▷ Anonymous functions635.29%
Constants251
▷ Global constants20.80%
▷ Class constants24999.20%
▷ Public constants249100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.16MB with 0.11MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png164.23KB52.22KB▼ 68.21%