10% stylish-links

Code Review | Stylish Links

WordPress plugin Stylish Links scored10%from 54 tests.

About plugin

  • Plugin page: stylish-links
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.5
  • WordPress version: 6.3.1
  • First release: Jun 6, 2017
  • Latest release: Aug 26, 2020
  • Number of updates: 18
  • Update frequency: every 65.4 days
  • Top authors: brianmcculloh (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

300+ active /4,607 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/stylish-links/options/inc/class.redux_filesystem.php+29
    Creating default object from empty value

Server metrics [RAM: ▼0.72MB] [CPU: ▼45.57ms] Passed 4 tests

Analyzing server-side resources used by Stylish Links
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.27 ▼0.1912.05 ▼30.21
Dashboard /wp-admin3.29 ▼0.0117.12 ▼26.50
Posts /wp-admin/edit.php3.29 ▼0.0715.20 ▼34.24
Add New Post /wp-admin/post-new.php3.29 ▼2.6012.32 ▼91.34
Media Library /wp-admin/upload.php3.29 ▲0.0614.07 ▼20.16
Icons /wp-admin/admin.php?page=sl_options&tab=33.2913.40
General /wp-admin/admin.php?page=sl_options&tab=13.2913.36
Import / Export /wp-admin/admin.php?page=sl_options&tab=53.2912.84
Options Object /wp-admin/admin.php?page=sl_options&tab=43.2913.03
Redux Framework /wp-admin/tools.php?page=redux-about3.2911.80
Colors /wp-admin/admin.php?page=sl_options&tab=23.2913.51

Server storage [IO: ▲3.69MB] [DB: ▲0.14MB] Passed 3 tests

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

Browser metrics Passed 4 tests

A check of browser resources used by Stylish Links
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,906 ▲14514.35 ▼0.361.54 ▼0.1044.06 ▲1.40
Dashboard /wp-admin2,304 ▲1275.66 ▲0.0484.05 ▼6.6142.76 ▲3.46
Posts /wp-admin/edit.php2,147 ▲501.98 ▼0.0042.94 ▲8.6334.77 ▲2.62
Add New Post /wp-admin/post-new.php1,572 ▲4417.96 ▼5.11638.73 ▼7.6272.30 ▲14.36
Media Library /wp-admin/upload.php1,444 ▲444.18 ▼0.0098.54 ▲0.0142.41 ▼3.23
Icons /wp-admin/admin.php?page=sl_options&tab=35,6863.95100.8359.72
General /wp-admin/admin.php?page=sl_options&tab=15,8504.60113.4287.46
Import / Export /wp-admin/admin.php?page=sl_options&tab=55,5613.5771.7333.62
Options Object /wp-admin/admin.php?page=sl_options&tab=45,5613.5469.8236.54
Redux Framework /wp-admin/tools.php?page=redux-about1,1053.6073.9666.25
Colors /wp-admin/admin.php?page=sl_options&tab=26,5124.59123.8842.55

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/stylish-links/options/inc/class.redux_filesystem.php+29
    Creating default object from empty value
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • redux_version_upgraded_from
    • widget_theysaidso_widget
    • widget_recent-comments
    • sl_settings-transients
    • sl_settings
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sl_options&tab=2
    • > Warning in wp-content/plugins/stylish-links/options/inc/class.redux_filesystem.php+29
    Creating default object from empty value
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=redux-about
    • > Error in wp-includes/Requests/src/Exception/InvalidArgument.php+29
    Uncaught WpOrg\Requests\Exception\InvalidArgument: WpOrg\Requests\Cookie::__construct(): Argument #1 ($name) must be of type string, integer given in wp-includes/Requests/src/Exception/InvalidArgument.php:29
    Stack trace:
    #0 wp-includes/Requests/src/Cookie.php(84): WpOrg\Requests\Exception\InvalidArgument::create()
    #1 wp-includes/class-wp-http.php(472): WpOrg\Requests\Cookie->__construct()
    #2 wp-includes/class-wp-http.php(352): WP_Http::normalize_cookies()
    #3 wp-includes/http.php(150): WP_Http->request()
    #4 wp-content/plugins/stylish-links/options/inc/class.p.php(230): wp_remote_request()
    #5 wp-includes/class-wp-hook.php(310): Redux_P->proxy()
    #6 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #7 wp-includes/plugin.php(517): WP_Hook->do_action()
    #8 wp-admin/admin-ajax.php(188): do_action()
    #9 {main}
    thrown

SRP 50% 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
  • 20× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/stylish-links/options/templates/panel/header.tpl.php:11
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/stylish-links/options/templates/panel/footer.tpl.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Panel' not found in wp-content/plugins/stylish-links/options/inc/extensions/customizer/inc/customizer_panel.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'themecheck' not found in wp-content/plugins/stylish-links/options/inc/themecheck/checks/full_package.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/stylish-links/options/templates/panel/menu_container.tpl.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/stylish-links/options/inc/welcome/views/about.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Section' not found in wp-content/plugins/stylish-links/options/inc/extensions/customizer/inc/customizer_section.php:12
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/stylish-links/options/templates/panel/container.tpl.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/stylish-links/options/inc/fields/select/elusive-icons.php:312
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/stylish-links/options/inc/welcome/views/changelog.php:2

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 take a look at the following user-side issues
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sl_options&tab=4
    • > Network (severe)
    wp-admin/admin-ajax.php?action=redux_p&nonce=23571b1564&url=http%3A%2F%2Fads.reduxframework.com%2Fapi%2Findex.php%3Fjs%26g%261%26v%3D2&proxy=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin-ajax.php%3Faction%3Dredux_p%26nonce%3D23571b1564%26url%3D - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=sl_options&tab=3
    • > Security (severe) in unknown
    /wp-admin/admin.php?page=sl_options&tab=3 - Refused to execute script from '/wp-admin/admin-ajax.php?action=redux_p&nonce=23571b1564&url=http%3A%2F%2Fads.reduxframework.com%2Fapi%2Findex.php%3Fjs%26g%261%26v%3D2&proxy=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin-ajax.php%3Faction%3Dredux_p%26nonce%3D23571b1564%26url%3D' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
    • > GET request to /wp-admin/admin.php?page=sl_options&tab=1
    • > Security (severe) in unknown
    /wp-admin/admin.php?page=sl_options&tab=1 - Refused to execute script from '/wp-admin/admin-ajax.php?action=redux_p&nonce=23571b1564&url=http%3A%2F%2Fads.reduxframework.com%2Fapi%2Findex.php%3Fjs%26g%261%26v%3D2&proxy=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin-ajax.php%3Faction%3Dredux_p%26nonce%3D23571b1564%26url%3D' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
    • > GET request to /wp-admin/admin.php?page=sl_options&tab=4
    • > Security (severe) in unknown
    /wp-admin/admin.php?page=sl_options&tab=4 - Refused to execute script from '/wp-admin/admin-ajax.php?action=redux_p&nonce=23571b1564&url=http%3A%2F%2Fads.reduxframework.com%2Fapi%2Findex.php%3Fjs%26g%261%26v%3D2&proxy=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin-ajax.php%3Faction%3Dredux_p%26nonce%3D23571b1564%26url%3D' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
7 plugin tags: anchor links, link hovers, css3 links, animated links, link effects...

stylish-links/stylish-links.php 85% from 13 tests

The main file in "Stylish Links" v. 1.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 148 characters long)
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin37,532 lines of code in 297 files:
LanguageFilesBlank linesComment linesLines of code
PHP1053,7085,48915,792
JavaScript862,6001,95012,001
Sass541,181607,568
SVG100934
JSON11840909
CSS481036247
LESS22081

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
It is recommended to fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 113)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity32.30
▷ Minimum class complexity1.00
▷ Maximum class complexity880.00
Average method complexity6.53
▷ Minimum method complexity1.00
▷ Maximum method complexity113.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes102
▷ Abstract classes00.00%
▷ Concrete classes102100.00%
▷ Final classes00.00%
Methods578
▷ Static methods10017.30%
▷ Public methods43775.61%
▷ Protected methods9115.74%
▷ Private methods508.65%
Functions16
▷ Named functions1593.75%
▷ Anonymous functions16.25%
Constants57
▷ Global constants00.00%
▷ Class constants57100.00%
▷ Public constants57100.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
25 compressed PNG files occupy 0.04MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
options/assets/img/1c.png0.13KB0.13KB▼ 0.72%
options/assets/css/vendor/jquery-ui-bootstrap/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
options/assets/css/vendor/jquery-ui-bootstrap/images/ui-icons_f6cf3b_256x240.png8.68KB4.11KB▼ 52.68%
options/assets/css/vendor/jquery-ui-bootstrap/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
options/inc/fields/spinner/arrow_left.png0.15KB0.12KB▼ 16.67%