83% custom-post-type-templates-for-elementor

Code Review | Custom post type templates for Elementor

WordPress plugin Custom post type templates for Elementor scored83%from 54 tests.

About plugin

  • Plugin page: custom-post-type-...
  • Plugin version: 1.10.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.3.1
  • WordPress version: 6.3.1
  • First release: May 25, 2022
  • Latest release: Oct 11, 2023
  • Number of updates: 31
  • Update frequency: every 16.3 days
  • Top authors: migaweb (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

200+ active /1,816 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.11MB] [CPU: ▼16.28ms] Passed 4 tests

This is a short check of server-side resources used by Custom post type templates for Elementor
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▼0.6316.84 ▼25.93
Dashboard /wp-admin3.37 ▲0.0651.56 ▼3.66
Posts /wp-admin/edit.php3.49 ▲0.1344.12 ▼5.68
Add New Post /wp-admin/post-new.php5.97 ▲0.0883.32 ▼29.85
Media Library /wp-admin/upload.php3.30 ▲0.0637.02 ▲0.77
Custom post pages /wp-admin/admin.php?page=miga-custom-posts-detailpage3.3143.75

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

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

Browser metrics Passed 4 tests

Custom post type templates for Elementor: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,452 ▼30914.17 ▼0.210.64 ▼1.3021.13 ▼21.98
Dashboard /wp-admin2,205 ▲285.63 ▲0.0390.56 ▼0.8639.94 ▼2.52
Posts /wp-admin/edit.php2,110 ▲72.05 ▲0.0434.36 ▼5.2230.73 ▼5.70
Add New Post /wp-admin/post-new.php1,533 ▲221.91 ▼1.46683.54 ▲13.7571.69 ▼0.34
Media Library /wp-admin/upload.php1,404 ▲104.18 ▼0.1399.84 ▲1.2846.25 ▲0.98
Custom post pages /wp-admin/admin.php?page=miga-custom-posts-detailpage8472.0227.5826.53

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
  • 15× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/custom-post-type-templates-for-elementor/widgets/PostList_error_message.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/custom-post-type-templates-for-elementor/widgets/PostImage.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/custom-post-type-templates-for-elementor/miga_custom_posts.php:82
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/custom-post-type-templates-for-elementor/widgets/PostList_filter.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/custom-post-type-templates-for-elementor/widgets/PostList_image.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/custom-post-type-templates-for-elementor/widgets/PostList_styles.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/custom-post-type-templates-for-elementor/widgets/PostContent.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/custom-post-type-templates-for-elementor/widgets/PostList_tags.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/custom-post-type-templates-for-elementor/widgets/PostsList.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/custom-post-type-templates-for-elementor/widgets/PostList_show_details.php:3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
8 plugin tags: elementor, elements, elementor addons, templates, addons...

custom-post-type-templates-for-elementor/miga_custom_posts.php 69% from 13 tests

"Custom post type templates for Elementor" version 1.10.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("custom-post-type-templates-for-elementor.php" instead of "miga_custom_posts.php")
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.0" instead of "5.2")
  • Description: The description should be shorter than 140 characters (currently 207 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin2,125 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP18234421,771
JavaScript2284148
CSS2160113
PO File1374193

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity9.67
▷ Minimum class complexity4.00
▷ Maximum class complexity26.00
Average method complexity2.37
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods38
▷ Static methods00.00%
▷ Public methods2668.42%
▷ Protected methods1231.58%
▷ Private methods00.00%
Functions16
▷ Named functions1487.50%
▷ Anonymous functions212.50%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/placeholder.png5.52KB2.20KB▼ 60.13%