62% addon-library

Code Review | Addon Library

WordPress plugin Addon Library scored 62% from 54 tests.

About plugin

  • Plugin page: addon-library
  • Plugin version: 1.3.76
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.4
  • WordPress version: 5.8.1
  • First release: Dec 26, 2016
  • Latest release: Jun 25, 2020
  • Number of updates: 65
  • Update frequency: every 19.5 days
  • Top authors: unitecms (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

2,000+ active / 46,539 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲3.50MB] [CPU: ▼132.18ms] Passed 4 tests

Server-side resources used by Addon Library
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /5.60 ▲2.7643.50 ▲16.11
Dashboard /wp-admin6.86 ▲3.7956.35 ▲11.54
Posts /wp-admin/edit.php6.91 ▲3.8055.77 ▲12.18
Add New Post /wp-admin/post-new.php9.14 ▲3.7193.59 ▼568.53
Media Library /wp-admin/upload.php6.74 ▲3.7448.35 ▲21.60
General Settings /wp-admin/admin.php?page=unitecreator_settings6.8050.30
Addons for Visual Composer /wp-admin/admin.php?page=unitecreator6.7548.73

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 744 new files
Database: 2 new tables, 1 new option
New tables
wp_addonlibrary_categories
wp_addonlibrary_addons
New WordPress options
untecreator_state

Browser metrics Passed 4 tests

A check of browser resources used by Addon Library
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,735 ▲13415.69 ▼0.355.05 ▼3.3876.87 ▲2.48
Dashboard /wp-admin3,001 ▲1026.24 ▲0.10120.06 ▼12.47189.82 ▲15.62
Posts /wp-admin/edit.php2,811 ▲743.41 ▲0.1765.70 ▲3.21142.42 ▲1.23
Add New Post /wp-admin/post-new.php3,776 ▲7818.07 ▼0.52424.13 ▼19.05199.01 ▲28.40
Media Library /wp-admin/upload.php1,821 ▲665.97 ▲0.45133.41 ▼10.17210.03 ▲27.98
General Settings /wp-admin/admin.php?page=unitecreator_settings2,4685.2986.66141.98
Addons for Visual Composer /wp-admin/admin.php?page=unitecreator2,5675.7894.85167.45

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie tables detected upon uninstall: 2 tables
    • wp_addonlibrary_addons
    • wp_addonlibrary_categories
  • This plugin does not fully uninstall, leaving 1 option in the database
    • untecreator_state

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=unitecreator
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/addon-library/inc_php/unitecreator_addons.class.php+431
    implode(): Passing glue string after array is deprecated. Swap the parameters

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
  • 99× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/addon-library/inc_php/framework/base_output.class.php
    • > /wp-content/plugins/addon-library/inc_php/unitecreator_actions.class.php
    • > /wp-content/plugins/addon-library/inc_php/framework/instagram/obj_item.class.php
    • > /wp-content/plugins/addon-library/provider/provider_db.class.php
    • > /wp-content/plugins/addon-library/inc_php/unitecreator_helper.class.php
    • > /wp-content/plugins/addon-library/provider/provider_layout.class.php
    • > /wp-content/plugins/addon-library/settings/addon_fields.php
    • > /wp-content/plugins/addon-library/inc_php/plugins/unitecreator_plugin_filters.class.php
    • > /wp-content/plugins/addon-library/inc_php/framework/instagram/instagram.api.class.php
    • > /wp-content/plugins/addon-library/inc_php/framework/font_manager.class.php
  • 178× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\odeVisitor\\AbstractNodeVisitor' not found in wp-content/plugins/addon-library/vendor/twig/twig/src/NodeVisitor/SafeAnalysisNodeVisitor.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\Binary\\AbstractBinary' not found in wp-content/plugins/addon-library/vendor/twig/twig/src/Node/Expression/Binary/DivBinary.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\TokenParser\\AbstractTokenParser' not found in wp-content/plugins/addon-library/vendor/twig/twig/src/TokenParser/ApplyTokenParser.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\AbstractExpression' not found in wp-content/plugins/addon-library/vendor/twig/twig/src/Node/Expression/Binary/AbstractBinary.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig\\RuntimeLoader\\RuntimeLoaderInterface' not found in wp-content/plugins/addon-library/vendor/twig/twig/src/RuntimeLoader/ContainerRuntimeLoader.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/addon-library/provider/functions_wordpress.class.php:43
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\Binary\\AbstractBinary' not found in wp-content/plugins/addon-library/vendor/twig/twig/src/Node/Expression/Binary/ModBinary.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addon-library/provider/provider_main_file.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\CallExpression' not found in wp-content/plugins/addon-library/vendor/twig/twig/src/Node/Expression/FilterExpression.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\AbstractExpression' not found in wp-content/plugins/addon-library/vendor/twig/twig/src/Node/Expression/NameExpression.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Plugin Name: Please specify the plugin name on the first line ( === addon-library === )
The official readme.txt is a good inspiration

addon-library/addonlibrary.php 92% from 13 tests

The primary PHP file in "Addon Library" version 1.3.76 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("addon-library.php" instead of "addonlibrary.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin84,801 lines of code in 628 files:
LanguageFilesBlank linesComment linesLines of code
PHP52315,67811,95135,191
JavaScript529,8546,71930,919
CSS271,38032513,225
SVG2003,356
HTML91151725
Markdown31450645
XML91210573
JSON300167

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity9.85
▷ Minimum class complexity1.00
▷ Maximum class complexity217.00
Average method complexity2.68
▷ Minimum method complexity1.00
▷ Maximum method complexity69.00
Code structure
Namespaces24
Interfaces26
Traits0
Classes465
▷ Abstract classes143.01%
▷ Concrete classes45196.99%
▷ Final classes40.89%
Methods2,646
▷ Static methods48318.25%
▷ Public methods1,77166.93%
▷ Protected methods35513.42%
▷ Private methods52019.65%
Functions78
▷ Named functions7292.31%
▷ Anonymous functions67.69%
Constants353
▷ Global constants51.42%
▷ Class constants34898.58%
▷ Public constants348100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
80 PNG files occupy 0.12MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icon_arrow_right.png0.26KB0.37KB0.00%
images/preview.png0.67KB0.60KB▼ 10.85%
images/icon_script.png0.84KB1.01KB0.00%
provider/assets/images/ui-icons_2e83ff_256x240.png4.44KB4.17KB▼ 6.02%
provider/assets/images/ui-bg_flat_0_aaaaaa_40x100.png0.21KB0.08KB▼ 58.96%