66% preloader-for-divi

Code Review | Preloader for Divi

WordPress plugin Preloader for Divi scored 66% from 54 tests.

About plugin

  • Plugin page: preloader-for-divi
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.8.1
  • WordPress version: 5.9.2
  • First release: Jan 25, 2020
  • Latest release: Oct 20, 2021
  • Number of updates: 17
  • Update frequency: every 37.5 days
  • Top authors: hidivi (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

400+ active / 3,745 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲4.82MB] [CPU: ▲469.33ms] 50% from 4 tests

A check of server-side resources used by Preloader for Divi
Please take the time to fix the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 1,017.39ms on /wp-admin/admin.php?page=freemius)
  • Extra CPU: The extra CPU usage should be kept under 200.00ms (currently 469.33ms on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.42 ▲4.9082.94 ▲32.19
Dashboard /wp-admin8.43 ▲5.032,354.38 ▲2,320.82
Posts /wp-admin/edit.php8.44 ▲4.801,078.79 ▲1,041.82
Add New Post /wp-admin/post-new.php11.54 ▲4.571,095.49 ▼167.87
Media Library /wp-admin/upload.php8.43 ▲5.14993.71 ▲971.17
Redux Framework /wp-admin/tools.php?page=redux-about8.44941.21
Freemius Debug [v.2.3.2] /wp-admin/admin.php?page=freemius8.431,017.39

Server storage [IO: ▲8.49MB] [DB: ▲0.06MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 614 new files
Database: no new tables, 7 new options
New WordPress options
divipreloader_opts
redux_version_upgraded_from
fs_accounts
divipreloader_opts-transients
fs_gdpr
fs_active_plugins
fs_debug_mode

Browser metrics Passed 4 tests

An overview of browser requirements for Preloader for Divi
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,110 ▲35616.33 ▲0.3011.79 ▲4.703.03 ▲0.79
Dashboard /wp-admin3,059 ▲1986.11 ▼0.08120.64 ▼18.06173.02 ▲13.39
Posts /wp-admin/edit.php2,771 ▲833.27 ▲0.0464.31 ▼0.27155.92 ▲12.54
Add New Post /wp-admin/post-new.php1,701 ▲4017.06 ▲0.95441.50 ▲13.20155.18 ▼5.72
Media Library /wp-admin/upload.php1,775 ▲775.63 ▲0.19145.57 ▲9.08199.82 ▲12.79
Redux Framework /wp-admin/tools.php?page=redux-about1,3784.06107.68235.84
Freemius Debug [v.2.3.2] /wp-admin/admin.php?page=freemius1,4662.7454.45113.90

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/preloader-for-divi/freemius/includes/class-freemius.php+8218
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 7 options
    • fs_active_plugins
    • fs_debug_mode
    • fs_gdpr
    • divipreloader_opts-transients
    • fs_accounts
    • divipreloader_opts
    • redux_version_upgraded_from

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/preloader-for-divi/freemius/templates/ajax-loader.php
  • 29× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/preloader-for-divi/freemius/templates/account/partials/addon.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/preloader-for-divi/divipreloader_options/inc/welcome/views/changelog.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/preloader-for-divi/divipreloader_options/inc/welcome/views/support.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/preloader-for-divi/divipreloader_options/inc/welcome/views/extensions.php:64
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Panel' not found in wp-content/plugins/preloader-for-divi/divipreloader_options/inc/extensions/customizer/inc/customizer_panel.php:11
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/preloader-for-divi/freemius/templates/account/partials/addon.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/preloader-for-divi/freemius/templates/account/partials/addon.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/preloader-for-divi/divipreloader_options/templates/panel/header.tpl.php:11
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/preloader-for-divi/divipreloader_options/templates/panel/footer.tpl.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Section' not found in wp-content/plugins/preloader-for-divi/divipreloader_options/inc/extensions/customizer/inc/customizer_devs.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Requires php: Invalid plugin version format
  • Screenshots: These screenshots do not have images: #1 (This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif).), #2 (This is the second screen shot)
You can take inspiration from this readme.txt

preloader-for-divi/divi_preloader.php 92% from 13 tests

The entry point to "Preloader for Divi" version 1.4 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("preloader-for-divi.php" instead of "divi_preloader.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected86,454 lines of code in 448 files:
LanguageFilesBlank linesComment linesLines of code
PHP21110,80221,24545,527
PO File126,9608,45515,240
JavaScript923,1902,39314,782
Sass541,187607,580
SVG17071,330
CSS60196581,033
JSON11840909
LESS10053

PHP code 0% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 2,772)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 113)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity49.16
▷ Minimum class complexity1.00
▷ Maximum class complexity2,772.00
Average method complexity5.25
▷ Minimum method complexity1.00
▷ Maximum method complexity113.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes148
▷ Abstract classes21.35%
▷ Concrete classes14698.65%
▷ Final classes00.00%
Methods1,708
▷ Static methods27416.04%
▷ Public methods1,22771.84%
▷ Protected methods1066.21%
▷ Private methods37521.96%
Functions104
▷ Named functions10399.04%
▷ Anonymous functions10.96%
Constants179
▷ Global constants9754.19%
▷ Class constants8245.81%
▷ Public constants82100.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
37 compressed PNG files occupy 0.33MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
divipreloader_options/assets/css/vendor/jquery-ui-bootstrap/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
divipreloader_options/assets/css/vendor/jquery-ui-bootstrap/images/ui-icons_888888_256x240.png4.27KB4.11KB▼ 3.78%
divipreloader_options/assets/css/vendor/jquery-ui-bootstrap/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
divipreloader_options/assets/css/vendor/jquery-ui-bootstrap/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
assets/admin/img/upgrade-s.png125.29KB54.19KB▼ 56.75%