10% general-options

Code Review | General Options

WordPress plugin General Options scored10%from 54 tests.

About plugin

  • Plugin page: general-options
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.0.2
  • WordPress version: 6.3.1
  • First release: Jul 6, 2018
  • Latest release: Dec 25, 2018
  • Number of updates: 7
  • Update frequency: every 24.6 days
  • Top authors: yog2515 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /740 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/general-options/general-options.php+59
    Undefined index: page

Server metrics [RAM: ▼1.96MB] [CPU: ▼49.76ms] Passed 4 tests

Server-side resources used by General Options
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.435.60 ▼33.61
Dashboard /wp-admin2.05 ▼1.265.55 ▼40.69
Posts /wp-admin/edit.php2.05 ▼1.315.46 ▼41.94
Add New Post /wp-admin/post-new.php2.05 ▼3.845.12 ▼82.80
Media Library /wp-admin/upload.php2.05 ▼1.185.08 ▼26.83
General Options Settings /wp-admin/admin.php?page=ad_general_options_setting2.9922.66
Shortcode List /wp-admin/admin.php?page=shortcode_list2.9924.32
/wp-admin/admin.php?page=ad_general_option_request&page=ad_general_option_request2.9924.24

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 51 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by General Options
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲9113.29 ▼1.341.70 ▼0.1643.48 ▲1.05
Dashboard /wp-admin2,232 ▲416.01 ▲0.1396.55 ▼13.3172.00 ▲27.87
Posts /wp-admin/edit.php2,118 ▲262.00 ▼0.1238.04 ▲1.2134.23 ▼0.38
Add New Post /wp-admin/post-new.php1,690 ▲15622.44 ▼0.69683.39 ▲29.3444.56 ▼11.88
Media Library /wp-admin/upload.php1,417 ▲354.23 ▲0.0496.28 ▲0.0672.18 ▲31.22
General Options Settings /wp-admin/admin.php?page=ad_general_options_setting1,1081.8337.6959.43
Shortcode List /wp-admin/admin.php?page=shortcode_list9662.0324.1533.28
/wp-admin/admin.php?page=ad_general_option_request&page=ad_general_option_request6791.146.7814.09

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/general-options/general-options.php+59
    Undefined index: page
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ad_general_option_request&page=ad_general_option_request
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ad_general_option_request&page=ad_general_option_request
    • > Warning in wp-includes/pluggable.php+1438
    Cannot modify header information - headers already sent by (output started at wp-includes/script-loader.php:2838)

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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (17 tag instead of maximum 10)
  • Screenshots: Screenshot #1 (Theme Options) image required
Please take inspiration from this readme.txt

general-options/general-options.php Passed 13 tests

The main file in "General Options" v. 1.1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
43 characters long description:
This are General Options for Wordpress Site

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
Success! There were no dangerous files found in this plugin10,302 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
CSS41,388247,111
Sass1319221,158
LESS1319311,149
SVG200733
PHP508150
JavaScript1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
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%
Functions7
▷ Named functions7100.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
settings.png1.02KB1.16KB0.00%
assets/images/icon.png0.32KB0.39KB0.00%