72% post-custom-templates-lite

Code Review | Post Custom Templates Lite

WordPress plugin Post Custom Templates Lite scored72%from 54 tests.

About plugin

  • Plugin page: post-custom-templ...
  • Plugin version: 1.14
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.9
  • WordPress version: 6.3.1
  • First release: Sep 29, 2016
  • Latest release: Mar 2, 2022
  • Number of updates: 15
  • Update frequency: every 133.6 days
  • Top authors: OTWthemes (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active /32,558 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲2.26MB] [CPU: ▲11.48ms] Passed 4 tests

This is a short check of server-side resources used by Post Custom Templates Lite
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /5.72 ▲2.2659.86 ▲22.39
Dashboard /wp-admin5.61 ▲2.3159.76 ▲9.42
Posts /wp-admin/edit.php5.69 ▲2.3364.47 ▲17.08
Add New Post /wp-admin/post-new.php8.02 ▲2.1398.27 ▼2.97
Media Library /wp-admin/upload.php5.62 ▲2.3962.85 ▲28.18
otwfcr /wp-admin/admin.php?page=otwfcr5.5946.91
Single Posts Templates /wp-admin/admin.php?page=otw-pctl5.6046.54
License Manager /wp-admin/admin.php?page=otw-pctl-lm5.60292.34
Edit Single Posts Templates /wp-admin/admin.php?page=otw-pctl-default-templates-edit5.6250.08
Action Single Posts Templates /wp-admin/admin.php?page=otw-pctl-custom-templates-action5.6049.86
Add Template /wp-admin/admin.php?page=otw-pctl-custom-templates-add5.6253.84
Options /wp-admin/admin.php?page=otw-pctl-settings5.6257.92
Edit Single Posts Templates /wp-admin/admin.php?page=otw-pctl-custom-templates-edit5.6253.58

Server storage [IO: ▲8.26MB] [DB: ▲0.01MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Please fix the following
  • Illegal file modification detected: 2 files (0.14KB) outside of "wp-content/plugins/post-custom-templates-lite/" and "wp-content/uploads/"
    • (new file) wp-admin/otw_pct_ct_1.css
    • (new file) wp-admin/otw_pct_ct_2.css
Filesystem: 264 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
otw_mb_custom_templates
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Post Custom Templates Lite
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲8614.62 ▲0.272.38 ▲0.7435.76 ▼3.18
Dashboard /wp-admin2,242 ▲625.80 ▲0.1394.58 ▲8.1182.05 ▲41.99
Posts /wp-admin/edit.php2,153 ▲532.38 ▲0.3739.92 ▼0.2236.79 ▲2.27
Add New Post /wp-admin/post-new.php1,740 ▲19022.92 ▲4.75648.55 ▲29.1456.66 ▼17.33
Media Library /wp-admin/upload.php1,447 ▲504.51 ▲0.36110.57 ▲12.9291.05 ▲46.09
otwfcr /wp-admin/admin.php?page=otwfcr8201.9224.8825.16
Single Posts Templates /wp-admin/admin.php?page=otw-pctl9262.0325.4736.97
License Manager /wp-admin/admin.php?page=otw-pctl-lm9641.8026.9327.39
Edit Single Posts Templates /wp-admin/admin.php?page=otw-pctl-default-templates-edit1,0193.4151.6166.10
Action Single Posts Templates /wp-admin/admin.php?page=otw-pctl-custom-templates-action8761.8125.3725.46
Add Template /wp-admin/admin.php?page=otw-pctl-custom-templates-add1,8273.8045.8883.34
Options /wp-admin/admin.php?page=otw-pctl-settings1,1903.3746.3086.48
Edit Single Posts Templates /wp-admin/admin.php?page=otw-pctl-custom-templates-edit1,7883.7244.8669.49

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

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

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=otw-pctl-default-templates-edit
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'otw_pctl_default_templates_edit' not found or invalid function name
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=otw-pctl-settings
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/post-custom-templates-lite/include/otw_components/otw_factory/views/action_message.php
    • > /wp-content/plugins/post-custom-templates-lite/include/otw_components/otw_post_template_shortcode/libs/recaptcha-php-1.11/example-mailhide.php
  • 57× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'OTW_Post_Template_Shortcodes' not found in wp-content/plugins/post-custom-templates-lite/include/otw_components/otw_post_template_shortcode/shortcodes/otw_shortcode_breadcrumbs.class.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/post-custom-templates-lite/include/otw_components/otw_content_sidebars_light/views/content_sidebars_metabox.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'OTW_Component' not found in wp-content/plugins/post-custom-templates-lite/include/otw_components/otw_content_sidebars_light/otw_content_sidebars.class.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'OTW_Component' not found in wp-content/plugins/post-custom-templates-lite/include/otw_components/otw_factory/otw_factory.class.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'OTW_Post_Template_Shortcodes' not found in wp-content/plugins/post-custom-templates-lite/include/otw_components/otw_post_template_shortcode/shortcodes/otw_shortcode_post_item_media.class.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/post-custom-templates-lite/include/otw_labels/otw_pctl_shortcode_object.labels.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/post-custom-templates-lite/include/otw_labels/otw_pctl_factory_object.labels.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/post-custom-templates-lite/include/views/components/title.php:3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/post-custom-templates-lite/include/views/components/item_media.php on line 2
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/post-custom-templates-lite/include/views/components/item_media.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
  • Screenshots: These screenshots do not have images: #1 (Custom template example 1), #2 (Custom template example 2), #3 (Custom template example 3), #4 (Custom template example 4), #5 (Custom template example 5), #6 (Custom template example 6), #7 (Custom template example 7), #8 (Custom template example 8), #9 (Ready template - Post Simple), #10 (Admin area - Create a templte - Template Builder), #11 (Admin area - Create a templte - Adding sidebars to your template), #12 (Admin area - Create a templte - Meta Drag & Drop), #13 (Admin area - Create a templte - Template Options), #14 (Admin area - Change template)
The official readme.txt might help

post-custom-templates-lite/otw_post_custom_templates_lite.php 92% from 13 tests

The main file in "Post Custom Templates Lite" v. 1.14 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("post-custom-templates-lite.php" instead of "otw_post_custom_templates_lite.php")

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
Success! There were no dangerous files found in this plugin29,795 lines of code in 119 files:
LanguageFilesBlank linesComment linesLines of code
CSS251,22242212,764
PHP663,0061,4509,970
SVG6003,793
JavaScript221,0601013,268

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity56.60
▷ Minimum class complexity1.00
▷ Maximum class complexity200.00
Average method complexity5.70
▷ Minimum method complexity1.00
▷ Maximum method complexity97.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes25
▷ Abstract classes00.00%
▷ Concrete classes25100.00%
▷ Final classes00.00%
Methods296
▷ Static methods175.74%
▷ Public methods24582.77%
▷ Protected methods289.46%
▷ Private methods237.77%
Functions72
▷ Named functions72100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
91 compressed PNG files occupy 1.07MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-10.png60.53KB27.56KB▼ 54.46%
include/otw_components/otw_post_template_grid_manager_light/img/gm-clone.png0.21KB0.24KB0.00%
include/otw_components/otw_post_template_shortcode/images-shortcodes/patterns/dimension.png0.54KB0.57KB0.00%
include/otw_components/otw_post_template_shortcode/images-shortcodes/icons/flatified/file.png1.65KB1.36KB▼ 17.50%
include/otw_components/otw_post_template_shortcode/images/pattern-1.png0.08KB0.09KB0.00%