93% advanced-page-template

Code Review | Advanced Page Template

WordPress plugin Advanced Page Template scored 93% from 54 tests.

About plugin

  • Plugin page: advanced-page-tem...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-3.9
  • WordPress version: 5.9.2
  • First release: Jun 9, 2014
  • Latest release: Dec 3, 2014
  • Number of updates: 13
  • Update frequency: every 13.5 days
  • Top authors: xingxing2d (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 2,900 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼295.34ms] Passed 4 tests

Analyzing server-side resources used by Advanced Page Template
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0355.91 ▲4.39
Dashboard /wp-admin3.44 ▲0.0231.73 ▼3.04
Posts /wp-admin/edit.php3.67 ▲0.0236.58 ▼1.75
Add New Post /wp-admin/post-new.php6.92 ▼0.0596.86 ▼1,175.06
Media Library /wp-admin/upload.php3.32 ▲0.0124.90 ▼1.49

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Advanced Page Template
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,787 ▲6515.83 ▲0.196.77 ▲0.802.05 ▼0.56
Dashboard /wp-admin2,897 ▲436.11 ▼0.03117.34 ▼19.32155.43 ▼2.87
Posts /wp-admin/edit.php2,696 ▲23.24 ▼0.1363.58 ▲1.55140.99 ▼3.21
Add New Post /wp-admin/post-new.php1,670 ▲918.39 ▲2.48400.25 ▼44.77156.56 ▼4.32
Media Library /wp-admin/upload.php1,700 ▲25.50 ▲0.02138.18 ▼3.56186.87 ▲2.66

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
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-page-template/index.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 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Configuring the Custom Fields in the template file), #2 (Check custom fields out on the backend)
You can look at the official readme.txt

advanced-page-template/index.php 85% from 13 tests

The main PHP script in "Advanced Page Template" version 1.1 is automatically included on every request by WordPress
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 177 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("advanced-page-template.php" instead of "index.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
Good job! No executable or dangerous file extensions detected162 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP16316155
CSS1107

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 1.13MB with 0.67MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png603.02KB243.22KB▼ 59.67%
screenshot-1.png557.31KB235.41KB▼ 57.76%