77% advanced-custom-types-for-divi

Code Review | Divi Advanced Custom Types

WordPress plugin Divi Advanced Custom Types scored77%from 54 tests.

About plugin

  • Plugin page: advanced-custom-t...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.2.9
  • WordPress version: 6.3.1
  • First release: Jul 3, 2019
  • Latest release: Jul 22, 2019
  • Number of updates: 19
  • Update frequency: every 1.1 days
  • Top authors: capellopablo (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

200+ active /3,302 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼0.21MB] [CPU: ▼17.06ms] Passed 4 tests

An overview of server-side resources used by Divi Advanced Custom Types
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0342.20 ▲1.59
Dashboard /wp-admin3.09 ▼0.2626.08 ▼36.91
Posts /wp-admin/edit.php3.23 ▼0.1338.95 ▼13.99
Add New Post /wp-admin/post-new.php5.49 ▼0.3983.73 ▼16.65
Media Library /wp-admin/upload.php3.18 ▼0.0531.20 ▼0.69

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Divi Advanced Custom Types
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲6514.72 ▲0.111.73 ▼0.0847.04 ▼0.37
Dashboard /wp-admin2,202 ▲225.74 ▲0.1090.37 ▼6.9879.51 ▲37.16
Posts /wp-admin/edit.php2,119 ▲161.94 ▼0.0336.59 ▼0.2535.57 ▼2.63
Add New Post /wp-admin/post-new.php1,699 ▲17322.46 ▼0.54694.45 ▲23.7053.64 ▼2.65
Media Library /wp-admin/upload.php1,422 ▲224.21 ▲0.04101.26 ▼8.1765.99 ▲21.55

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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 take a closer look at the following
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/advanced-custom-types-for-divi/public/partials/act-divi-public-display.php
    • > /wp-content/plugins/advanced-custom-types-for-divi/trunk/public/partials/act-divi-public-display.php
    • > /wp-content/plugins/advanced-custom-types-for-divi/admin/partials/act-divi-admin-display.php
    • > /wp-content/plugins/advanced-custom-types-for-divi/trunk/admin/partials/act-divi-admin-display.php
  • 23× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'DiviExtension' not found in wp-content/plugins/advanced-custom-types-for-divi/includes/AdvancedCustomTypesForDivi.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/advanced-custom-types-for-divi/includes/modules/ACTPostTypeGrid/layouts/ACTPostFullWidth.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'ET_Builder_Module' not found in wp-content/plugins/advanced-custom-types-for-divi/includes/modules/ACTPostTypeGrid/ACTPostTypeGrid.php:3
    • > PHP Notice
      Undefined variable: props in wp-content/plugins/advanced-custom-types-for-divi/includes/modules/ACTPostTypeGrid/layouts/cards.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/advanced-custom-types-for-divi/includes/modules/ACTPostTypeGrid/layouts/cards.php:50
    • > PHP Fatal error
      Uncaught Error: Class 'DiviExtension' not found in wp-content/plugins/advanced-custom-types-for-divi/trunk/includes/AdvancedCustomTypesForDivi.php:3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/advanced-custom-types-for-divi/includes/modules/ACTPostTypeGrid/layouts/cards.php on line 17
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/advanced-custom-types-for-divi/includes/modules/ACTPostTypeGrid/layouts/cards.php on line 17
    • > PHP Notice
      Undefined variable: props in wp-content/plugins/advanced-custom-types-for-divi/trunk/includes/modules/ACTPostTypeGrid/layouts/cards.php on line 17
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/advanced-custom-types-for-divi/trunk/includes/modules/ACTPostTypeGrid/layouts/cards.php on line 17

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Please a description for screenshot #6 in advanced-custom-types-for-divi/assets to your readme.txt
You can look at the official readme.txt

advanced-custom-types-for-divi/advanced-custom-types-divi.php 85% from 13 tests

The main PHP script in "Divi Advanced Custom Types" version 1.0.1 is automatically included on every request by WordPress
It is important to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("advanced-custom-types-for-divi.php" instead of "advanced-custom-types-divi.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected3,062 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP235131,0052,187
Markdown12120453
PO File2182224416
CSS20104
JavaScript2002

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity10.22
▷ Minimum class complexity1.00
▷ Maximum class complexity41.00
Average method complexity2.77
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes23
▷ Abstract classes14.35%
▷ Concrete classes2295.65%
▷ Final classes00.00%
Methods120
▷ Static methods1915.83%
▷ Public methods10890.00%
▷ Protected methods00.00%
▷ Private methods1210.00%
Functions16
▷ Named functions1275.00%
▷ Anonymous functions425.00%
Constants2
▷ Global constants2100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/img/Icon-30x30.png4.13KB0.63KB▼ 84.62%