10% stickyadmin

Code Review | StickyAdmin

WordPress plugin StickyAdmin scored 10% from 54 tests.

About plugin

  • Plugin page: stickyadmin
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.4
  • WordPress version: 5.8.1
  • First release: Dec 11, 2015
  • Latest release: Jan 9, 2016
  • Number of updates: 36
  • Update frequency: every 15.9 days
  • Top authors: dorian.tudorache (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

10+ active / 4,121 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/stickyadmin/lib/stickyadmin.class.php+1037
    Use of undefined constant STICKY_CACHE_URI - assumed 'STICKY_CACHE_URI' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▲2.97MB] [CPU: ▼157.77ms] Passed 4 tests

A check of server-side resources used by StickyAdmin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.29 ▲2.5778.82 ▲53.76
Dashboard /wp-admin6.34 ▲3.2973.63 ▲20.55
Posts /wp-admin/edit.php6.46 ▲3.3572.90 ▲26.17
Add New Post /wp-admin/post-new.php8.10 ▲2.67126.16 ▼711.81
Media Library /wp-admin/upload.php6.40 ▲3.4072.66 ▲34.02
Sticky Admin /wp-admin/options-general.php?page=options-general.php_sticky_admin6.3263.87

Server storage [IO: ▲24.39MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 457 new files
Database: 7 new tables, 1 new option
New tables
wp_sticky_stats_browsers
wp_sticky_stats_referers
wp_sticky_stats_visits
wp_sticky_stats_os
wp_sticky_stats_posts
wp_sticky_stats_pageviews
wp_sticky_stats_searches
New WordPress options
sticky_stats_internal

Browser metrics Passed 4 tests

This is an overview of browser requirements for StickyAdmin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,678 ▲1,08219.31 ▲3.6540.17 ▲29.61152.30 ▲101.36
Dashboard /wp-admin3,753 ▲82711.74 ▲5.81283.33 ▲125.04196.66 ▲76.63
Posts /wp-admin/edit.php2,971 ▲2323.98 ▲1.26122.25 ▲46.21166.03 ▲70.61
Add New Post /wp-admin/post-new.php4,194 ▲2,57919.79 ▼1.56623.01 ▲281.01185.13 ▲50.55
Media Library /wp-admin/upload.php2,365 ▲5587.05 ▲2.02213.77 ▲48.39129.30 ▼7.70
Sticky Admin /wp-admin/options-general.php?page=options-general.php_sticky_admin5,1995.52511.75252.49

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The plugin did not uninstall successfully, leaving 7 tables in the database
    • wp_sticky_stats_browsers
    • wp_sticky_stats_os
    • wp_sticky_stats_searches
    • wp_sticky_stats_referers
    • wp_sticky_stats_visits
    • wp_sticky_stats_pageviews
    • wp_sticky_stats_posts
  • The uninstall procedure has failed, leaving 1 option in the database
    • sticky_stats_internal

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 22 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=options-general.php_sticky_admin
    • > Deprecated in wp-content/plugins/stickyadmin/lib/includes/sticky_functions.php+36
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=options-general.php_sticky_admin
    • > POST request to /wp-admin/admin-ajax.php
    • > Error in wp-content/plugins/stickyadmin/lib/classes/sticky-stats.php+601
    Uncaught Error: Class 'Reader' not found in wp-content/plugins/stickyadmin/lib/classes/sticky-stats.php:601
    Stack trace:
    #0 wp-content/plugins/stickyadmin/lib/classes/sticky-stats.php(211): StickyStats::get_country()
    #1 wp-content/plugins/stickyadmin/lib/classes/sticky-stats.php(174): StickyStats::get_visitor_data()
    #2 wp-includes/class-wp-hook.php(303): StickyStats::sticky_stats_track()
    #3 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(470): WP_Hook->do_action()
    #5 wp-admin/admin-ajax.php(187): do_action()
    #6 {main}
    thrown

SRP 50% 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 fix the following items
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'StickyAdmin' not found in wp-content/plugins/stickyadmin/lib/includes/sticky_body_class.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sticky_icons() in wp-content/plugins/stickyadmin/lib/includes/sticky_ajax_css.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/stickyadmin/lib/sticky_options.php:15
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/stickyadmin/lib/sticky_options.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'StickyAdmin' not found in wp-content/plugins/stickyadmin/lib/classes/sticky-stats.php:16

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)
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=options-general.php_sticky_admin
    • > Network (severe)
    wp-admin/admin-ajax.php - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/options-general.php?page=options-general.php_sticky_admin
    • > Console-api (warning) in unknown
    /wp-includes/js/jquery/jquery.min.js?ver=3.6.0 1:31592 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at apc_init (/wp-content/plugins/stickyadmin/lib/classes/admin-page-class/js/Admin_Page_Class.js:251:34)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/stickyadmin/lib/classes/admin-page-class/js/Admin_Page_Class.js:21:5)\n at e (/wp-includes/js/jquery/jquery.min.js?ver=3.6.0:2:30038)\n at t (/wp-includes/js/jquery/jquery.min.js?ver=3.6.0:2:30340)" undefined
    • > GET request to /wp-admin/options-general.php?page=options-general.php_sticky_admin
    • > Javascript (severe) in unknown
    /wp-includes/js/jquery/jquery.min.js?ver=3.6.0 1:31702 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Tags: You are using too many tags: 19 tag instead of maximum 10
The official readme.txt is a good inspiration

stickyadmin/index.php 92% from 13 tests

The main PHP script in "StickyAdmin" version 1.0.6 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("stickyadmin.php" instead of "index.php")

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
No dangerous file extensions were detected180,461 lines of code in 350 files:
LanguageFilesBlank linesComment linesLines of code
CSS2493,3542,89460,128
SVG180252,810
JavaScript444,5494,26734,628
HTML103,969221,923
PHP221,3214,4229,334
PO File56337311,565
Markdown122038
JSON10035

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity113.82
▷ Minimum class complexity1.00
▷ Maximum class complexity395.00
Average method complexity4.10
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods400
▷ Static methods12932.25%
▷ Public methods30075.00%
▷ Protected methods7318.25%
▷ Private methods276.75%
Functions37
▷ Named functions37100.00%
▷ Anonymous functions00.00%
Constants52
▷ Global constants3975.00%
▷ Class constants1325.00%
▷ Public constants13100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
31 compressed PNG files occupy 0.09MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/assets/sticky-logo-114.png7.67KB2.75KB▼ 64.16%
lib/classes/admin-page-class/css/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
lib/images/w-logo-white.png4.06KB4.07KB0.00%
lib/css/images/input-checked.png0.31KB0.32KB0.00%
lib/classes/admin-page-class/css/images/ui-bg_inset-soft_95_fef1ec_1x100.png0.12KB0.16KB0.00%