84% append-or-prepend-content

Code Review | Append or Prepend Content

WordPress plugin Append or Prepend Content scored84%from 54 tests.

About plugin

  • Plugin page: append-or-prepend...
  • Plugin version: 2.1.0
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-5.9
  • WordPress version: 6.3.1
  • First release: Mar 18, 2016
  • Latest release: Mar 23, 2022
  • Number of updates: 24
  • Update frequency: every 91.5 days
  • Top authors: igmoweb (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /7,390 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼4.26ms] Passed 4 tests

Server-side resources used by Append or Prepend Content
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1043.10 ▲0.95
Dashboard /wp-admin3.43 ▲0.1348.84 ▼1.30
Posts /wp-admin/edit.php3.54 ▲0.1944.78 ▼2.99
Add New Post /wp-admin/post-new.php6.07 ▲0.1885.79 ▼13.69
Media Library /wp-admin/upload.php3.35 ▲0.1236.99 ▲2.03
Append or Prepend Content /wp-admin/edit.php?post_type=append_or_prepend3.3938.35

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 20 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-comments
app_or_prep_version
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Append or Prepend Content
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.22 ▼1.532.28 ▲0.3541.77 ▼0.63
Dashboard /wp-admin2,213 ▲245.85 ▼0.22100.90 ▼23.9241.98 ▼3.84
Posts /wp-admin/edit.php2,090 ▲12.01 ▼0.0037.33 ▼0.9537.56 ▲1.44
Add New Post /wp-admin/post-new.php1,536 ▲823.34 ▲5.06682.81 ▲58.3254.98 ▼4.93
Media Library /wp-admin/upload.php1,395 ▲74.21 ▼0.0898.68 ▼0.8244.05 ▲0.71
Append or Prepend Content /wp-admin/edit.php?post_type=append_or_prepend1,0571.9532.9231.04

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • app_or_prep_version
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function AppOrPrepend\\plugin_dir_path() in wp-content/plugins/append-or-prepend-content/app-prep-content.php:29

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
3 plugin tags: content, posts, custom post type

append-or-prepend-content/app-prep-content.php 85% from 13 tests

The main file in "Append or Prepend Content" v. 2.1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("append-or-prepend-content.php" instead of "app-prep-content.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
No dangerous file extensions were detected632 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP879124362
JavaScript7180166
PO File13538104

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions24
▷ Named functions2395.83%
▷ Anonymous functions14.17%
Constants7
▷ Global constants00.00%
▷ Class constants7100.00%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin