68% custom-page-templates-by-vegacorp

Code Review | WP Page Templates

WordPress plugin WP Page Templates scored68%from 54 tests.

About plugin

  • Plugin page: custom-page-templ...
  • Plugin version: 1.1.15
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-6.3
  • WordPress version: 6.3.1
  • First release: Jun 17, 2017
  • Latest release: Aug 29, 2023
  • Number of updates: 45
  • Update frequency: every 50.4 days
  • Top authors: JoseVega (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

700+ active /41,611 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.55MB] [CPU: ▼6.66ms] 75% from 4 tests

An overview of server-side resources used by WP Page Templates
Please have a look at the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 1,766.36ms on /wp-admin/admin.php?page=wcpt_welcome_page)
PageMemory (MB)CPU Time (ms)
Home /4.08 ▲0.6241.68 ▲2.88
Dashboard /wp-admin3.92 ▲0.5849.20 ▼11.40
Posts /wp-admin/edit.php3.98 ▲0.6247.10 ▼2.39
Add New Post /wp-admin/post-new.php6.45 ▲0.5692.55 ▼12.01
Media Library /wp-admin/upload.php3.68 ▲0.4638.27 ▼0.83
WP Templates /wp-admin/admin.php?page=wcpt_welcome_page4.191,766.36
WP Templates /wp-admin/admin.php?page=wcpt_whats_new3.6337.91
Freemius Debug [v.2.5.11] /wp-admin/admin.php?page=freemius4.0435.82

Server storage [IO: ▲3.80MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 246 new files
Database: no new tables, 10 new options
New WordPress options
fs_active_plugins
fs_accounts
db_upgraded
can_compress_scripts
wcpt_welcome_redirect
fs_debug_mode
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for WP Page Templates
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲6313.73 ▼0.901.83 ▼0.1433.12 ▼9.77
Dashboard /wp-admin2,243 ▲554.96 ▲0.07102.79 ▼12.8640.53 ▼3.87
Posts /wp-admin/edit.php2,126 ▲372.00 ▼0.0537.93 ▲2.1236.52 ▲5.21
Add New Post /wp-admin/post-new.php1,535 ▲2123.56 ▲6.10581.89 ▼84.5948.43 ▼8.35
Media Library /wp-admin/upload.php1,425 ▲404.21 ▼0.0197.70 ▼10.2142.89 ▼3.50
WP Templates /wp-admin/admin.php?page=wcpt_welcome_page9941.7125.3858.42
WP Templates /wp-admin/admin.php?page=wcpt_whats_new8862.1425.5628.19
Freemius Debug [v.2.5.11] /wp-admin/admin.php?page=freemius1,0941.7122.9827.74

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/custom-page-templates-by-vegacorp/vendor/freemius/wordpress-sdk/includes/class-freemius.php+8515
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 10 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • wcpt_welcome_redirect
    • fs_debug_mode
    • fs_accounts
    • fs_active_plugins
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

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
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=wcpt_whats_new
    • > Warning in wp-content/plugins/custom-page-templates-by-vegacorp/vendor/vegacorp/vg-freemius-sdk/index.php+164
    include(wp-content/plugins/custom-page-templates-by-vegacorp/views/whats-new/1.1.15.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/admin.php?page=wcpt_whats_new
    • > Warning in wp-content/plugins/custom-page-templates-by-vegacorp/vendor/vegacorp/vg-freemius-sdk/index.php+164
    include(): Failed opening 'wp-content/plugins/custom-page-templates-by-vegacorp/views/whats-new/1.1.15.php' for inclusion (include_path='.:/usr/share/php')
    • > GET request to /wp-admin/admin.php?page=wcpt_whats_new
    • > Notice in wp-content/plugins/custom-page-templates-by-vegacorp/vendor/vegacorp/vg-freemius-sdk/index.php+166
    Undefined variable: items

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
Almost there! Just fix the following items
  • 13× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/custom-page-templates-by-vegacorp/views/metabox.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function VG_Page_Layouts_Instance() in wp-content/plugins/custom-page-templates-by-vegacorp/views/upgrade-message.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/custom-page-templates-by-vegacorp/vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/custom-page-templates-by-vegacorp/views/metabox.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/custom-page-templates-by-vegacorp/vendor/vegacorp/vg-freemius-sdk/views/page-template.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_html_class() in wp-content/plugins/custom-page-templates-by-vegacorp/views/sidebar.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/custom-page-templates-by-vegacorp/views/whats-new/1.1.0.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/custom-page-templates-by-vegacorp/views/welcome-page-content.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/custom-page-templates-by-vegacorp/vendor/vegacorp/vg-freemius-sdk/samples/email-optin-form.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/custom-page-templates-by-vegacorp/vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2109

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: custom pages, wp page templates, custom templates, wordpress templates, woocommerce templates

custom-page-templates-by-vegacorp/page-layouts.php 92% from 13 tests

The main PHP script in "WP Page Templates" version 1.1.15 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("custom-page-templates-by-vegacorp.php" instead of "page-layouts.php")

Code Analysis 97% from 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
Good job! No executable or dangerous file extensions detected42,253 lines of code in 180 files:
LanguageFilesBlank linesComment linesLines of code
PHP1378,66419,18035,975
PO File171,4491,9934,842
Markdown41850778
JavaScript48477430
JSON100110
CSS157091
XML23027

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
It is recommended to fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,087)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity82.43
▷ Minimum class complexity1.00
▷ Maximum class complexity3,087.00
Average method complexity4.52
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes60
▷ Abstract classes23.33%
▷ Concrete classes5896.67%
▷ Final classes00.00%
Methods1,415
▷ Static methods20714.63%
▷ Public methods1,00070.67%
▷ Protected methods402.83%
▷ Private methods37526.50%
Functions107
▷ Named functions10699.07%
▷ Anonymous functions10.93%
Constants153
▷ Global constants10367.32%
▷ Class constants5032.68%
▷ Public constants50100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/freemius/wordpress-sdk/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assets/imgs/logo.png7.44KB3.88KB▼ 47.91%
vendor/freemius/wordpress-sdk/assets/img/custom-page-templates-by-vegacorp.png21.61KB10.06KB▼ 53.42%
vendor/freemius/wordpress-sdk/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%