84% expand-divi

Code Review | Expand Divi

WordPress plugin Expand Divi scored84%from 54 tests.

About plugin

  • Plugin page: expand-divi
  • Plugin version: 1.6.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.2
  • WordPress version: 6.3.1
  • First release: Dec 9, 2017
  • Latest release: Aug 2, 2019
  • Number of updates: 33
  • Update frequency: every 18.2 days
  • Top authors: faycalboutam (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

2,000+ active /23,020 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.29MB] [CPU: ▼8.37ms] Passed 4 tests

A check of server-side resources used by Expand Divi
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2528.86 ▼18.30
Dashboard /wp-admin3.61 ▲0.3152.87 ▼0.60
Posts /wp-admin/edit.php3.73 ▲0.3749.30 ▼5.67
Add New Post /wp-admin/post-new.php6.19 ▲0.3189.51 ▼8.91
Media Library /wp-admin/upload.php3.54 ▲0.3141.16 ▲4.95
Expand Divi /wp-admin/tools.php?page=expand-divi3.5339.66

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 86 new files
Database: no new tables, 9 new options
New WordPress options
widget_expand_divi_recent_posts_widget
db_upgraded
widget_ed_contact_info
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_expand_divi_twitter_feed
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Expand Divi
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.24 ▼0.111.61 ▼0.1939.78 ▼3.84
Dashboard /wp-admin2,199 ▲225.56 ▼0.1193.93 ▼5.6141.04 ▼1.62
Posts /wp-admin/edit.php2,104 ▲42.02 ▼0.0235.50 ▼4.6633.88 ▼4.32
Add New Post /wp-admin/post-new.php1,531 ▲522.96 ▼0.17661.44 ▼8.2252.97 ▲3.96
Media Library /wp-admin/upload.php1,404 ▲44.18 ▼0.0193.89 ▼7.3042.59 ▼3.09
Expand Divi /wp-admin/tools.php?page=expand-divi1,3101.8729.3530.69

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • db_upgraded
    • widget_ed_contact_info
    • widget_expand_divi_twitter_feed
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_expand_divi_recent_posts_widget
    • widget_recent-comments
    • can_compress_scripts

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)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 13× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Abraham\\TwitterOAuth\\Tests\\AbstractSignatureMethodTest' not found in wp-content/plugins/expand-divi/inc/lib/twitteroauth/tests/HmacSha1Test.php:7
    • > PHP Warning
      require_once(EXPAND_DIVI_PATHinc/functions.php): failed to open stream: No such file or directory in wp-content/plugins/expand-divi/inc/temp/share_icons.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/expand-divi/inc/lib/twitteroauth/tests/ConsumerTest.php:7
    • > PHP Warning
      require(wp-content/plugins/expand-divi/inc/lib/twitteroauth/tests/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/expand-divi/inc/lib/twitteroauth/tests/bootstrap.php on line 3
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/expand-divi/inc/lib/twitteroauth/tests/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/expand-divi/inc/lib/twitteroauth/tests/bootstrap.php on line 3
    • > PHP Warning
      Use of undefined constant EXPAND_DIVI_PATH - assumed 'EXPAND_DIVI_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/expand-divi/inc/temp/share_icons.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/expand-divi/inc/lib/twitteroauth/tests/TwitterOAuthTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Abraham\\TwitterOAuth\\Config' not found in wp-content/plugins/expand-divi/inc/lib/twitteroauth/src/TwitterOAuth.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Abraham\\TwitterOAuth\\SignatureMethod' not found in wp-content/plugins/expand-divi/inc/lib/twitteroauth/src/HmacSha1.php:15
    • > PHP Fatal error
      require_once(): Failed opening required 'EXPAND_DIVI_PATHinc/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/expand-divi/inc/temp/share_icons.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add descriptions for these screenshots #6, #7, #8 in expand-divi/assets to your readme.txt
The official readme.txt might help

expand-divi/expand-divi.php Passed 13 tests

This is the main PHP file of "Expand Divi" version 1.6.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
54 characters long description:
A plugin that adds more functionlity to the Divi theme

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin9,061 lines of code in 60 files:
LanguageFilesBlank linesComment linesLines of code
SVG40125,833
PHP434391,0242,599
CSS32036445
Markdown434069
JavaScript29445
JSON10034
XML22123
YAML10013

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity8.50
▷ Minimum class complexity1.00
▷ Maximum class complexity60.00
Average method complexity2.56
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes34
▷ Abstract classes25.88%
▷ Concrete classes3294.12%
▷ Final classes00.00%
Methods168
▷ Static methods74.17%
▷ Public methods14787.50%
▷ Protected methods52.98%
▷ Private methods169.52%
Functions10
▷ Named functions550.00%
▷ Anonymous functions550.00%
Constants17
▷ Global constants1482.35%
▷ Class constants317.65%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin