62% my-tips

Code Review | My Tips

WordPress plugin My Tips scored62%from 54 tests.

About plugin

  • Plugin page: my-tips
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.2-3.4.2
  • WordPress version: 6.3.1
  • First release: Oct 21, 2012
  • Latest release: Nov 4, 2012
  • Number of updates: 15
  • Update frequency: every 0.9 days
  • Top authors: hu2008yinxiang (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,176 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼1.20MB] [CPU: ▼45.39ms] Passed 4 tests

This is a short check of server-side resources used by My Tips
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.78 ▼0.6913.97 ▼31.01
Dashboard /wp-admin2.82 ▼0.4920.12 ▼33.19
Posts /wp-admin/edit.php2.82 ▼0.5416.95 ▼36.39
Add New Post /wp-admin/post-new.php2.82 ▼3.0717.34 ▼80.95
Media Library /wp-admin/upload.php2.82 ▼0.4115.40 ▼21.81
配置My Tips /wp-admin/options-general.php?page=mytipsconfig2.8219.94

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
mytips_options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for My Tips
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,913 ▲15213.49 ▼1.159.76 ▲7.9742.84 ▼1.43
Dashboard /wp-admin2,202 ▲315.61 ▲0.0992.31 ▼10.4343.21 ▲1.61
Posts /wp-admin/edit.php2,101 ▲11.97 ▲0.0236.76 ▲1.3637.19 ▲3.75
Add New Post /wp-admin/post-new.php1,536 ▲1023.14 ▲0.17624.07 ▼71.4356.98 ▲5.50
Media Library /wp-admin/upload.php1,404 ▲44.22 ▲0.0198.05 ▼2.8345.75 ▼0.63
配置My Tips /wp-admin/options-general.php?page=mytipsconfig1,1742.0022.2662.23

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method MyTips::mytips_init() should not be called statically
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=mytipsconfig
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method MyTips::mytips_init() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=mytipsconfig
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method MyTips::mytips_add_menu() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=mytipsconfig
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method MyTips::mytips_admin_page() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=mytipsconfig
    • > 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/options-general.php?page=mytipsconfig
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=mytipsconfig
    • > Deprecated in wp-content/plugins/my-tips/js/mytips-class.php+78
    Non-static method MyTips::mytips_verify_options() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=mytipsconfig
    • > Deprecated in wp-content/plugins/my-tips/js/mytips-class.php+80
    Non-static method MyTips::mytips_get_options() should not be called statically

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/my-tips/js/jquery.mytips.php
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Trying to access array offset on value of type bool in wp-content/plugins/my-tips/js/jquery.mytips.php on line 134
    • > PHP Notice
      Undefined index: load in wp-content/plugins/my-tips/js/jquery.mytips.php on line 127
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/my-tips/js/jquery.mytips.php on line 134
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/my-tips/mytips.php:15

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)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Please fix the following attributes:
  • Donate link: Invalid url: ""
You can take inspiration from this readme.txt

my-tips/mytips.php 85% from 13 tests

Analyzing the main PHP file in "My Tips" version 1.0.3
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("my-tips.php" instead of "mytips.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 435 characters long)

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
There were no executable files found in this plugin4,188 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript15857833,249
CSS112635412
PHP346159358
PO File26468169

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity43.00
▷ Minimum class complexity43.00
▷ Maximum class complexity43.00
Average method complexity4.82
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods763.64%
▷ Protected methods00.00%
▷ Private methods436.36%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants00.00%
▷ Class constants6100.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected