78% custom-post-type-layout

Code Review | Custom Post Layout

WordPress plugin Custom Post Layout scored78%from 54 tests.

About plugin

  • Plugin page: custom-post-type-...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.2
  • WordPress version: 6.3.1
  • First release: Aug 2, 2021
  • Latest release: Apr 5, 2023
  • Number of updates: 12
  • Update frequency: every 51.2 days
  • Top authors: zamirvc (58.33%)viitorcloudvc (50%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /354 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼3.00ms] Passed 4 tests

This is a short check of server-side resources used by Custom Post Layout
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0337.02 ▼1.28
Dashboard /wp-admin3.34 ▲0.0457.74 ▲7.99
Posts /wp-admin/edit.php3.40 ▲0.0444.98 ▼2.34
Add New Post /wp-admin/post-new.php5.94 ▲0.0681.72 ▼9.68
Media Library /wp-admin/upload.php3.27 ▲0.0431.65 ▲1.31
Add New Layout /wp-admin/admin.php?page=vc_create_shortcodes3.3531.55
Custom Post Type Layout /wp-admin/admin.php?page=vc_list_shortcode3.2831.21

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Custom Post Layout
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,849 ▲8813.11 ▼1.174.97 ▲3.1643.77 ▲0.37
Dashboard /wp-admin2,228 ▲515.71 ▲0.1185.49 ▼1.0636.67 ▼4.49
Posts /wp-admin/edit.php2,133 ▲332.06 ▲0.0835.02 ▲0.1733.84 ▼6.40
Add New Post /wp-admin/post-new.php1,554 ▲2823.10 ▼0.47668.96 ▼10.2259.49 ▲2.92
Media Library /wp-admin/upload.php1,433 ▲334.28 ▲0.0796.42 ▼12.4642.46 ▼4.72
Add New Layout /wp-admin/admin.php?page=vc_create_shortcodes1,3081.7928.1630.51
Custom Post Type Layout /wp-admin/admin.php?page=vc_list_shortcode8591.7024.2124.48

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • cbw_primary_key

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=vc_create_shortcodes
    • > Warning in wp-content/plugins/custom-post-type-layout/admin/shortcodes/create_shortcodesform.php+213
    Illegal string offset 'vc_sg_page_parent'
    • > GET request to /wp-admin/admin.php?page=vc_create_shortcodes
    • > Notice in wp-content/plugins/custom-post-type-layout/admin/shortcodes/create_shortcodesform.php+213
    Uninitialized string offset: 0

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
The following issues need your attention
  • 18× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_types() in wp-content/plugins/custom-post-type-layout/admin/shortcodes/create_shortcodesform.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/custom-post-type-layout/admin/shortcodes/list_shortcodes.php:18
    • > PHP Notice
      Undefined variable: get_json_Data in wp-content/plugins/custom-post-type-layout/includes/number-pagination.php on line 19
    • > PHP Notice
      Undefined variable: get_json_Data in wp-content/plugins/custom-post-type-layout/includes/number-pagination.php on line 20
    • > PHP Notice
      Undefined variable: get_json_Data in wp-content/plugins/custom-post-type-layout/includes/number-pagination.php on line 21
    • > PHP Notice
      Undefined variable: get_json_Data in wp-content/plugins/custom-post-type-layout/includes/number-pagination.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/custom-post-type-layout/includes/number-pagination.php on line 20
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/custom-post-type-layout/includes/number-pagination.php on line 18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-post-type-layout/custom-post-layout-options.php:2
    • > PHP Notice
      Undefined variable: get_json_Data in wp-content/plugins/custom-post-type-layout/includes/number-pagination.php on line 5

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)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
1 plugin tags: postdesign

custom-post-type-layout/custom-post-layout.php 92% from 13 tests

The primary PHP file in "Custom Post Layout" version 1.0.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("custom-post-type-layout.php" instead of "custom-post-layout.php")

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 detected1,257 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP65190719
CSS17015344
SVG403143
JavaScript32351

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected