67% advisr-toolbox

Code Review | Advisr Toolbox

WordPress plugin Advisr Toolbox scored 67% from 54 tests.

About plugin

  • Plugin page: advisr-toolbox
  • Plugin version: 2.5.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.0.1
  • WordPress version: 6.3.1
  • First release: Sep 28, 2020
  • Latest release: Aug 10, 2022
  • Number of updates: 25
  • Update frequency: every 27.4 days
  • Top authors: pmreyes (84%)evthedev (20%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 653 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼0.56MB] [CPU: ▼8.52ms] Passed 4 tests

Analyzing server-side resources used by Advisr Toolbox
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0739.79 ▼2.24
Dashboard /wp-admin3.37 ▲0.0650.44 ▼2.89
Posts /wp-admin/edit.php3.42 ▲0.0651.42 ▲4.70
Add New Post /wp-admin/post-new.php3.45 ▼2.4461.88 ▼29.62
Media Library /wp-admin/upload.php3.29 ▲0.0635.15 ▲0.67
Team from Wordpress /wp-admin/edit.php?post_type=advisr-team-member3.3339.48
Advisr Toolbox /wp-admin/options-general.php?page=advisr-toolbox3.3331.59
Add New Team Member /wp-admin/post-new.php?post_type=advisr-team-member3.4047.15
Team from Advisr (Brokers) /wp-admin/edit.php?post_type=advisr-team-member&page=advisr-brokers3.3132.82

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 91 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Advisr Toolbox
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,972 ▲21513.80 ▼0.5112.49 ▲10.5638.91 ▼6.43
Dashboard /wp-admin2,247 ▲565.86 ▲0.91109.26 ▼5.9043.28 ▼4.61
Posts /wp-admin/edit.php2,124 ▲382.01 ▲0.0140.02 ▲4.8034.54 ▼1.33
Add New Post /wp-admin/post-new.php3,132 ▲1,6087.75 ▼15.56187.25 ▼483.0572.41 ▲12.92
Media Library /wp-admin/upload.php1,426 ▲414.29 ▲0.0794.08 ▼4.3942.42 ▼2.69
Team from Wordpress /wp-admin/edit.php?post_type=advisr-team-member1,0882.0034.7930.86
Advisr Toolbox /wp-admin/options-general.php?page=advisr-toolbox1,0961.8825.8127.15
Add New Team Member /wp-admin/post-new.php?post_type=advisr-team-member2,4107.77165.3461.15
Team from Advisr (Brokers) /wp-admin/edit.php?post_type=advisr-team-member&page=advisr-brokers8362.0524.7828.77

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=advisr-team-member&page=advisr-brokers
    • > Notice in wp-content/plugins/advisr-toolbox/admin/partials/advisr-toolbox-advisr-brokers-display.php+28
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=advisr-toolbox
    • > Notice in wp-content/plugins/advisr-toolbox/admin/partials/advisr-toolbox-admin-display.php+30
    Undefined index: email
    • > GET request to /wp-admin/options-general.php?page=advisr-toolbox
    • > Notice in wp-content/plugins/advisr-toolbox/admin/partials/advisr-toolbox-admin-display.php+31
    Undefined index: password
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=advisr-toolbox
    • > Notice in wp-content/plugins/advisr-toolbox/admin/partials/advisr-toolbox-admin-display.php+177
    Undefined index: submit
    • > GET request to /wp-admin/options-general.php?page=advisr-toolbox
    • > Notice in wp-content/plugins/advisr-toolbox/admin/partials/advisr-toolbox-admin-display.php+51
    Undefined variable: response
    • > GET request to /wp-admin/options-general.php?page=advisr-toolbox
    • > Notice in wp-content/plugins/advisr-toolbox/admin/partials/advisr-toolbox-admin-display.php+53
    Trying to get property 'token' of non-object
    • > GET request to /wp-admin/options-general.php?page=advisr-toolbox
    • > Notice in wp-content/plugins/advisr-toolbox/admin/partials/advisr-toolbox-admin-display.php+54
    Trying to get property 'message' of non-object
    • > GET request to /wp-admin/options-general.php?page=advisr-toolbox
    • > Notice in wp-content/plugins/advisr-toolbox/admin/partials/advisr-toolbox-admin-display.php+178
    Undefined index: slider_text_color

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/advisr-toolbox/public/partials/advisr-toolbox-public-display.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/advisr-toolbox/admin/partials/advisr-toolbox-advisr-brokers-display.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/advisr-toolbox/admin/partials/advisr-toolbox-admin-display.php:18

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=advisr-toolbox
    • > Rendering (warning) in unknown
    /wp-admin/options-general.php?page=advisr-toolbox 255 The specified value "#000" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/options-general.php?page=advisr-toolbox
    • > Javascript (severe) in unknown
    /wp-admin/options-general.php?page=advisr-toolbox - Access to fetch at 'https://advisr.com.au/api/v2/brokerages' from origin '' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
    • > GET request to /wp-admin/options-general.php?page=advisr-toolbox
    • > Network (severe)
    https://advisr.com.au/api/v2/brokerages - Failed to load resource: net::ERR_FAILED
    • > GET request to /wp-admin/options-general.php?page=advisr-toolbox
    • > Javascript (severe) in unknown
    /wp-admin/options-general.php?page=advisr-toolbox 377:46 Uncaught TypeError: Cannot read properties of undefined (reading 'data')
    • > GET request to /wp-admin/edit.php?post_type=advisr-team-member&page=advisr-brokers
    • > Javascript (severe) in unknown
    /wp-admin/edit.php?post_type=advisr-team-member&page=advisr-brokers 445:29 Uncaught SyntaxError: Unexpected token ';'

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Requires php: Version not formatted correctly
The official readme.txt might help

advisr-toolbox/advisr-toolbox.php Passed 13 tests

"Advisr Toolbox" version 2.5.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
80 characters long description:
Connect your native data with Advisr data to create dynamic team pages and more.

Code Analysis Passed 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
Everything looks great! No dangerous files found in this plugin39,234 lines of code in 56 files:
LanguageFilesBlank linesComment linesLines of code
CSS161,99719022,227
JavaScript152,3041,9549,210
SVG3002,677
Sass15641,795
TypeScript2265421,469
PHP133427171,249
HTML11210501
JSON30072
Markdown110031
LESS1003

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity5.86
▷ Minimum class complexity1.00
▷ Maximum class complexity19.00
Average method complexity1.69
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods54
▷ Static methods35.56%
▷ Public methods4990.74%
▷ Protected methods00.00%
▷ Private methods59.26%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.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
6 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/google-logo.png6.89KB3.42KB▼ 50.40%
public/border-star.png2.35KB0.73KB▼ 69.11%
admin/partials/logo.png9.96KB4.76KB▼ 52.25%
public/checked-icon.png0.38KB0.21KB▼ 43.38%
public/dark-star.png2.05KB0.48KB▼ 76.57%