83% advanced-page-template

Code Review | Advanced Page Template

WordPress plugin Advanced Page Template scored83%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: 6.3.1
  • 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 /3,139 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.01MB] [CPU: ▼6.56ms] Passed 4 tests

This is a short check of server-side resources used by Advanced Page Template
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0240.50 ▲1.42
Dashboard /wp-admin3.33 ▼0.0247.16 ▼14.67
Posts /wp-admin/edit.php3.38 ▲0.0245.59 ▼1.01
Add New Post /wp-admin/post-new.php5.91 ▲0.0382.01 ▼9.85
Media Library /wp-admin/upload.php3.25 ▲0.0232.95 ▼0.72

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Advanced Page Template
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲5514.35 ▲0.092.05 ▲0.3044.88 ▲0.77
Dashboard /wp-admin2,194 ▲175.50 ▼0.1098.02 ▼3.1641.68 ▼0.72
Posts /wp-admin/edit.php2,102 ▲21.97 ▼0.0335.64 ▼4.1532.86 ▲0.53
Add New Post /wp-admin/post-new.php1,528 ▼122.82 ▼0.74673.82 ▲52.8258.32 ▼4.54
Media Library /wp-admin/upload.php1,405 ▲114.24 ▲0.08100.74 ▼0.8845.39 ▲2.02

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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 fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > 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 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Screenshots: Add images for these screenshots: #1 (Configuring the Custom Fields in the template file), #2 (Check custom fields out on the backend)
You can take inspiration from this readme.txt

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

This is the main PHP file of "Advanced Page Template" version 1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("advanced-page-template.php" instead of "index.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 177 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin162 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP16316155
CSS1107

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
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

PNG files should be compressed to save space and minimize bandwidth usage
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%