84% layouts-for-divi

Code Review | Layouts for Divi

WordPress plugin Layouts for Divi scored84%from 54 tests.

About plugin

  • Plugin page: layouts-for-divi
  • Plugin version: 1.0.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.1
  • WordPress version: 6.3.1
  • First release: Sep 27, 2019
  • Latest release: Dec 8, 2022
  • Number of updates: 11
  • Update frequency: every 106.2 days
  • Top authors: giraphix (72.73%)techeshta (36.36%)

Code review

54 tests

User reviews

5 reviews

Install metrics

2,000+ active /23,989 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.12MB] [CPU: ▼5.37ms] Passed 4 tests

A check of server-side resources used by Layouts for Divi
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1140.08 ▲4.96
Dashboard /wp-admin3.42 ▲0.1148.38 ▼0.65
Posts /wp-admin/edit.php3.54 ▲0.1746.71 ▼1.03
Add New Post /wp-admin/post-new.php6.02 ▲0.1381.36 ▼16.32
Media Library /wp-admin/upload.php3.34 ▲0.1133.89 ▼3.49

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Layouts for Divi
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲3814.25 ▼0.101.70 ▲0.1144.50 ▲6.21
Dashboard /wp-admin2,205 ▲385.59 ▼0.0995.85 ▼3.0343.39 ▲2.13
Posts /wp-admin/edit.php2,110 ▲102.16 ▲0.1335.00 ▼1.8635.88 ▼4.13
Add New Post /wp-admin/post-new.php1,538 ▲1223.06 ▲0.02668.18 ▼7.7356.83 ▲1.21
Media Library /wp-admin/upload.php1,410 ▲134.20 ▼0.04106.81 ▲1.0245.84 ▲0.94

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

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)
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      include(ABSPATHwp-admin/includes/image.php): failed to open stream: No such file or directory in wp-content/plugins/layouts-for-divi/includes/class-layout-importer.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/layouts-for-divi/includes/class-layout-importer.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/layouts-for-divi/includes/layouts.php:3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/layouts-for-divi/includes/class-layout-importer.php on line 17
    • > PHP Warning
      include(): Failed opening 'ABSPATHwp-admin/includes/image.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/layouts-for-divi/includes/class-layout-importer.php on line 17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
8 plugin tags: free divi layouts packs, divi layouts module, free divi layouts, free divi templates, divi layouts...

layouts-for-divi/layouts-for-divi.php Passed 13 tests

The main PHP file in "Layouts for Divi" ver. 1.0.7 adds more information about the plugin and also serves as the entry point for this plugin
81 characters long description:
Beautifully designed, Free templates, Hand-crafted for popular Divi page builder.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected1,802 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
CSS22111753
PHP4116160640
JavaScript26873409

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity32.33
▷ Minimum class complexity13.00
▷ Maximum class complexity61.00
Average method complexity4.36
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods29
▷ Static methods13.45%
▷ Public methods2172.41%
▷ Protected methods00.00%
▷ Private methods827.59%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants450.00%
▷ Class constants450.00%
▷ Public constants4100.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/lfd-logo.png5.21KB2.49KB▼ 52.23%
assets/images/layouts-for-divi.png1.14KB0.42KB▼ 62.97%