83% solar-wizard-lite

Code Review | Solar Wizard Lite

WordPress plugin Solar Wizard Lite scored83%from 54 tests.

About plugin

  • Plugin page: solar-wizard-lite
  • Plugin version: 1.2.1
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3.1
  • WordPress version: 6.3.1
  • First release: May 13, 2021
  • Latest release: Oct 11, 2023
  • Number of updates: 23
  • Update frequency: every 38.4 days
  • Top authors: covertcommunication (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

200+ active /3,655 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.99MB] [CPU: ▲3.30ms] 75% from 4 tests

Server-side resources used by Solar Wizard Lite
Please fix the following
  • CPU: The total CPU usage must kept under 500.00ms (currently 518.71ms on /wp-admin/admin.php?page=solar_options)
PageMemory (MB)CPU Time (ms)
Home /4.28 ▲0.8139.81 ▲2.19
Dashboard /wp-admin4.42 ▲1.1151.43 ▲3.69
Posts /wp-admin/edit.php4.47 ▲1.1151.99 ▲4.91
Add New Post /wp-admin/post-new.php6.92 ▲1.0292.25 ▲4.07
Media Library /wp-admin/upload.php4.26 ▲1.0238.64 ▲3.26
Settings /wp-admin/admin.php?page=solar_options4.81518.71
Quotes /wp-admin/edit.php?post_type=quote4.3941.44

Server storage [IO: ▲1.24MB] [DB: ▲0.05MB] Passed 3 tests

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 57 new files
Database: no new tables, 42 new options
New WordPress options
sw_db_version
sw_disable_battery_option
sw_price_per_watt_panel_high_lease
sw_panel_watt
sw_email_at_wizard_completion
sw_loan_rate
sw_system_size_fixed_pricing_matrix
sw_wizard_title
sw_show_purchase_lease
sw_incentives_repeater_value
...

Browser metrics Passed 4 tests

Solar Wizard Lite: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,134 ▲34815.26 ▲0.6610.36 ▲8.5340.74 ▼6.91
Dashboard /wp-admin2,399 ▲2196.35 ▲0.69111.79 ▲23.5038.80 ▼6.07
Posts /wp-admin/edit.php2,324 ▲2243.66 ▲1.6848.99 ▲14.9133.71 ▼3.07
Add New Post /wp-admin/post-new.php1,577 ▲5123.65 ▲0.10655.18 ▼47.4639.39 ▼15.84
Media Library /wp-admin/upload.php1,467 ▲704.34 ▲0.1481.16 ▼14.9242.34 ▼3.10
Settings /wp-admin/admin.php?page=solar_options3,8215.0670.6591.02
Quotes /wp-admin/edit.php?post_type=quote1,3303.9045.2427.65

Uninstaller [IO: ▲0.00MB] [DB: ▲0.05MB] 75% 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
  • Zombie WordPress options were found after uninstall: 42 options
    • sw_email_enable_user_notification
    • sw_utility_increase_rate
    • sw_environmental_derate_factor
    • sw_credit_score
    • db_upgraded
    • sw_lease_credit_score
    • theysaidso_admin_options
    • sw_currency_symbol
    • sw_db_version
    • sw_secondary_color
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 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
Please fix the following
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/solar-wizard-lite/admin/admin_settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/solar-wizard-lite/admin/admin_settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/solar-wizard-lite/includes.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% 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 to be fixed: The official readme.txt might help

solar-wizard-lite/solar-wizard-lite.php 92% from 13 tests

The principal PHP file in "Solar Wizard Lite" v. 1.2.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis 97% from 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
Good job! No executable or dangerous file extensions detected12,710 lines of code in 50 files:
LanguageFilesBlank linesComment linesLines of code
PHP4186855,005
CSS678513,880
JavaScript82154733,188
SVG32026637

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 106)
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity114.33
▷ Minimum class complexity18.00
▷ Maximum class complexity187.00
Average method complexity6.31
▷ Minimum method complexity1.00
▷ Maximum method complexity106.00
Code structure
Namespaces0
Interfaces0
Traits1
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods64
▷ Static methods00.00%
▷ Public methods64100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.28MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/arrow.png0.42KB0.29KB▼ 30.30%
img/flags@2x.png170.28KB68.04KB▼ 60.04%
css/images/ui-icons_444444_256x240.png6.84KB4.18KB▼ 38.90%
img/flags.png69.20KB23.42KB▼ 66.16%
images/trusting_solar_image.png43.59KB17.79KB▼ 59.19%