77% advisr-toolbox

Code Review | Advisr Toolbox

WordPress plugin Advisr Toolbox scored 77% from 54 tests.

About plugin

  • Plugin page: advisr-toolbox
  • Plugin version: 2.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8
  • WordPress version: 5.9.2
  • First release: Sep 28, 2020
  • Latest release: Oct 27, 2021
  • Number of updates: 23
  • Update frequency: every 17.3 days
  • Top authors: pmreyes (82.61%)evthedev (21.74%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 399 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.76MB] [CPU: ▼305.29ms] Passed 4 tests

Analyzing server-side resources used by Advisr Toolbox
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.0957.20 ▲7.78
Dashboard /wp-admin3.48 ▲0.0735.69 ▲3.70
Posts /wp-admin/edit.php3.70 ▲0.0638.23 ▲2.75
Add New Post /wp-admin/post-new.php3.73 ▼3.2448.05 ▼1,229.02
Media Library /wp-admin/upload.php3.36 ▲0.0725.92 ▲1.42
Add New Team Member /wp-admin/post-new.php?post_type=advisr-team-member3.7041.65
Advisr Toolbox /wp-admin/options-general.php?page=advisr-toolbox3.4123.62
Team from Wordpress /wp-admin/edit.php?post_type=advisr-team-member3.4025.45
Team from Advisr (Brokers) /wp-admin/edit.php?post_type=advisr-team-member&page=advisr-brokers3.3822.27

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 91 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Advisr Toolbox
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,995 ▲24116.76 ▲0.8912.41 ▲6.652.50 ▼0.60
Dashboard /wp-admin2,941 ▲806.45 ▲0.16118.21 ▼19.06158.12 ▼6.48
Posts /wp-admin/edit.php2,741 ▲473.44 ▲0.0263.90 ▲0.91142.82 ▼3.55
Add New Post /wp-admin/post-new.php4,080 ▲2,4199.88 ▼8.39221.58 ▼192.64212.02 ▲46.52
Media Library /wp-admin/upload.php1,748 ▲505.73 ▲0.02125.30 ▼18.13185.05 ▼3.54
Add New Team Member /wp-admin/post-new.php?post_type=advisr-team-member3,13110.42197.11200.27
Advisr Toolbox /wp-admin/options-general.php?page=advisr-toolbox1,4722.6355.44114.24
Team from Wordpress /wp-admin/edit.php?post_type=advisr-team-member1,4143.3560.18113.74
Team from Advisr (Brokers) /wp-admin/edit.php?post_type=advisr-team-member&page=advisr-brokers1,0542.8253.43112.75

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 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+176
    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+50
    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+52
    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+53
    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+177
    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
Please 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× GET requests to PHP files have triggered server-side errors or warnings:
    • > 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
    • > 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

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=advisr-toolbox
    • > Rendering (warning) in unknown
    /wp-admin/options-general.php?page=advisr-toolbox 256 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/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 446:29 Uncaught SyntaxError: Unexpected token ';'

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% 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 your attention:
  • Requires php: Version format is invalid
You can look at the official readme.txt

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

"Advisr Toolbox" version 2.4.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
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
Good job! No executable or dangerous file extensions detected39,213 lines of code in 56 files:
LanguageFilesBlank linesComment linesLines of code
CSS161,99719022,227
JavaScript152,3031,9549,196
SVG3002,677
Sass15641,795
TypeScript2265421,469
PHP133417131,242
HTML11210501
JSON30072
Markdown110031
LESS1003

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
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

PNG files should be compressed to save space and minimize bandwidth usage
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/advisr-logo.png9.96KB4.76KB▼ 52.25%
public/border-star.png2.35KB0.73KB▼ 69.11%
public/google-logo.png6.89KB3.42KB▼ 50.40%
public/checked-icon.png0.38KB0.21KB▼ 43.38%
admin/partials/logo.png9.96KB4.76KB▼ 52.25%