94% additional-content

Code Review | Additional Content

WordPress plugin Additional Content scored 94% from 54 tests.

About plugin

  • Plugin page: additional-content
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4
  • WordPress version: 5.9.2
  • First release: Oct 21, 2015
  • Latest release: Apr 7, 2020
  • Number of updates: 27
  • Update frequency: every 60.4 days
  • Top authors: keesiemeijer (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 5,862 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.08MB] [CPU: ▼318.99ms] Passed 4 tests

This is a short check of server-side resources used by Additional Content
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.1659.99 ▲11.38
Dashboard /wp-admin3.51 ▲0.1033.38 ▼2.46
Posts /wp-admin/edit.php3.73 ▲0.0939.05 ▲0.98
Add New Post /wp-admin/post-new.php7.03 ▲0.05110.15 ▼1,275.31
Media Library /wp-admin/upload.php3.38 ▲0.0924.68 ▲0.82

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 24 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Additional Content
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,795 ▲4115.81 ▲0.035.73 ▲0.172.50 ▲0.15
Dashboard /wp-admin2,888 ▲306.15 ▼0.04119.80 ▼10.46155.50 ▼0.98
Posts /wp-admin/edit.php2,694 ▲33.23 ▼0.0164.25 ▼2.75141.22 ▼4.27
Add New Post /wp-admin/post-new.php1,880 ▲21922.95 ▲6.76397.68 ▼23.12165.98 ▼2.26
Media Library /wp-admin/upload.php1,695 ▼35.52 ▲0.02137.54 ▲0.32186.53 ▲4.01

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
Uninstaller ran successfully

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
The following issues need your attention
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: i in wp-content/plugins/additional-content/includes/partials/repeatable-fields.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_textarea() in wp-content/plugins/additional-content/includes/partials/repeatable-fields.php:4
    • > PHP Notice
      Undefined variable: i in wp-content/plugins/additional-content/includes/partials/repeatable-fields.php on line 3
    • > PHP Notice
      Undefined variable: label in wp-content/plugins/additional-content/includes/partials/repeatable-fields.php on line 3
    • > PHP Notice
      Undefined variable: describedby in wp-content/plugins/additional-content/includes/partials/repeatable-fields.php on line 4
    • > PHP Notice
      Undefined variable: i in wp-content/plugins/additional-content/includes/partials/repeatable-fields.php on line 4

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 issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
10 plugin tags: post, publish, shortcode, shortcodes, extra...

additional-content/additional-content.php 85% from 13 tests

Analyzing the main PHP file in "Additional Content" version 1.3.0
Please take the time to fix the following:
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")
  • Domain Path: Prefix the domain path with a forward slash character ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected1,032 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP16286544872
JavaScript24218133
JSON20027

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity20.25
▷ Minimum class complexity5.00
▷ Maximum class complexity39.00
Average method complexity3.20
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods35
▷ Static methods25.71%
▷ Public methods2982.86%
▷ Protected methods00.00%
▷ Private methods617.14%
Functions22
▷ Named functions2195.45%
▷ Anonymous functions14.55%
Constants4
▷ Global constants4100.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
No PNG images were found in this plugin