10% html-php-pages-and-posts

Code Review | Custom HTML/PHP Post Templates

WordPress plugin Custom HTML/PHP Post Templates scored10%from 54 tests.

About plugin

  • Plugin page: html-php-pages-an...
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.8
  • WordPress version: 6.3.1
  • First release: Dec 22, 2016
  • Latest release: Jul 9, 2017
  • Number of updates: 14
  • Update frequency: every 16.6 days
  • Top authors: stephenafamo (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /7,327 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/html-php-pages-and-posts/html-php-pages-and-posts.php+24
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.96MB] [CPU: ▼49.58ms] Passed 4 tests

Analyzing server-side resources used by Custom HTML/PHP Post Templates
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.76 ▼35.94
Dashboard /wp-admin2.05 ▼1.266.00 ▼46.99
Posts /wp-admin/edit.php2.05 ▼1.319.32 ▼39.41
Add New Post /wp-admin/post-new.php2.05 ▼3.849.93 ▼75.97
Media Library /wp-admin/upload.php2.05 ▼1.185.75 ▼31.05
Custom templates /wp-admin/options-general.php?page=html-php-pages-and-posts2.056.66

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Custom HTML/PHP Post Templates: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,943 ▲20815.03 ▲0.671.84 ▲0.0741.30 ▼5.00
Dashboard /wp-admin2,352 ▲1646.43 ▲1.56140.76 ▲23.4942.80 ▼0.80
Posts /wp-admin/edit.php2,252 ▲1633.40 ▲1.3850.15 ▲12.4931.62 ▼1.26
Add New Post /wp-admin/post-new.php6,287 ▲4,76819.04 ▼3.82902.53 ▲269.2441.92 ▼14.98
Media Library /wp-admin/upload.php1,388 ▼04.16 ▼0.0778.57 ▼16.5941.01 ▼2.09
Custom templates /wp-admin/options-general.php?page=html-php-pages-and-posts1,0413.0339.1826.01

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/html-php-pages-and-posts/html-php-pages-and-posts.php+24
    Trying to access array offset on value of type bool
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=html-php-pages-and-posts
    • > Notice in wp-content/plugins/html-php-pages-and-posts/partials/settings-page-display.php+21
    Trying to access array offset on value of type bool
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=html-php-pages-and-posts
    • > Warning in wp-content/plugins/html-php-pages-and-posts/partials/settings-page-display.php+53
    in_array() expects parameter 2 to be array, null given

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_types() in wp-content/plugins/html-php-pages-and-posts/partials/settings-page-display.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/html-php-pages-and-posts/html-php-pages-and-posts.php:23

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% 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
Attributes that require attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === html-php-pages-and-posts === )
The official readme.txt might help

html-php-pages-and-posts/html-php-pages-and-posts.php Passed 13 tests

The principal PHP file in "Custom HTML/PHP Post Templates" v. 2.0.0 is loaded by WordPress automatically on each request
64 characters long description:
Use uploaded html or php files as templates for pages and posts.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected294 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP27231256
JavaScript141438

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity27.00
▷ Minimum class complexity27.00
▷ Maximum class complexity27.00
Average method complexity2.86
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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