88% addon-library-layouts

Code Review | Addon Library Layouts Builder

WordPress plugin Addon Library Layouts Builder scored 88% from 54 tests.

About plugin

  • Plugin page: addon-library-lay...
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.7.1
  • WordPress version: 5.9.2
  • First release: Feb 27, 2017
  • Latest release: Jul 9, 2018
  • Number of updates: 6
  • Update frequency: every 82.5 days
  • Top authors: unitecms (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active / 2,295 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼304.30ms] Passed 4 tests

A check of server-side resources used by Addon Library Layouts Builder
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0154.83 ▲4.18
Dashboard /wp-admin3.42 ▲0.0233.28 ▲1.39
Posts /wp-admin/edit.php3.65 ▲0.0237.82 ▲0.08
Add New Post /wp-admin/post-new.php6.89 ▼0.0893.70 ▼1,218.40
Media Library /wp-admin/upload.php3.31 ▲0.0123.90 ▼0.26

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Addon Library Layouts Builder
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,815 ▲6116.29 ▲0.606.44 ▲0.202.58 ▲0.17
Dashboard /wp-admin2,912 ▲516.05 ▼0.14118.06 ▼16.18154.52 ▼7.42
Posts /wp-admin/edit.php2,708 ▲143.24 ▲0.0062.90 ▼1.84137.83 ▼5.97
Add New Post /wp-admin/post-new.php1,674 ▲1316.64 ▲0.09449.14 ▲14.63154.08 ▼2.90
Media Library /wp-admin/upload.php1,715 ▲175.51 ▼0.02143.43 ▲7.63186.53 ▲0.43

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
This plugin's uninstaller ran successfully

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

SRP 0% 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
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/addon-library-layouts/inc_php/plugin.class.php
    • > /wp-content/plugins/addon-library-layouts/inc_php/globals.class.php
    • > /wp-content/plugins/addon-library-layouts/inc_php/admin.class.php
    • > /wp-content/plugins/addon-library-layouts/inc_php/main_file.php
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/addon-library-layouts/views/standalone.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/addon-library-layouts/inc_php/globals.class.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/addon-library-layouts/inc_php/globals.class.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === addon-library-layouts === )
You can take inspiration from this readme.txt

addon-library-layouts/addon-library-layouts.php Passed 13 tests

The main PHP file in "Addon Library Layouts Builder" ver. 1.1.3 adds more information about the plugin and also serves as the entry point for this plugin
81 characters long description:
Addon Library Layouts Builder - Create and edit layouts from addon library addons

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected451 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP7297186437
JavaScript114714

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity15.00
▷ Minimum class complexity1.00
▷ Maximum class complexity38.00
Average method complexity2.08
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods39
▷ Static methods3179.49%
▷ Public methods3179.49%
▷ Protected methods615.38%
▷ Private methods25.13%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants433.33%
▷ Class constants866.67%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin