10% wp-post-type-widget

Code Review | WP Post Type & Widget

WordPress plugin WP Post Type & Widget scored10%from 54 tests.

About plugin

  • Plugin page: wp-post-type-widget
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Apr 30, 2020
  • Latest release: Jun 3, 2021
  • Number of updates: 9
  • Update frequency: every 44.4 days
  • Top authors: joysaha7302 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /395 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/wp-post-type-widget/webfiles/Base/MMWCPTWD_Activate.php+15
    Use of undefined constant MMWCPTWD_WPMIN_VERSION - assumed 'MMWCPTWD_WPMIN_VERSION' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.13ms] Passed 4 tests

Server-side resources used by WP Post Type & Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.91 ▼0.90
Dashboard /wp-admin3.31 ▲0.0145.70 ▼1.94
Posts /wp-admin/edit.php3.37 ▲0.0144.35 ▼4.43
Add New Post /wp-admin/post-new.php5.90 ▲0.0188.90 ▼5.24
Media Library /wp-admin/upload.php3.24 ▲0.0132.67 ▲1.06

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 80 new files
Database: no new tables, 12 new options
New WordPress options
mmwcptwd
mmwcptwd_tax
mmwcptwd_options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
last_code
widget_recent-comments
mmwcptwd_cpt
widget_recent-posts
...

Browser metrics Passed 4 tests

An overview of browser requirements for WP Post Type & Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.81 ▲0.461.58 ▼0.1640.59 ▼5.54
Dashboard /wp-admin2,203 ▲155.83 ▼0.0797.42 ▼19.7239.39 ▼3.59
Posts /wp-admin/edit.php2,089 ▼31.97 ▼0.0440.50 ▲2.2934.76 ▼0.84
Add New Post /wp-admin/post-new.php1,542 ▲918.08 ▼4.83603.01 ▼37.3865.46 ▲5.15
Media Library /wp-admin/upload.php1,391 ▼04.20 ▼0.0297.66 ▼6.6641.63 ▼0.43

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
    • last_code
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-post-type-widget/mmwcptwd.php
  • 13× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'rsCustomPost\\Base\\MMWCPTWD_BaseController' not found in wp-content/plugins/wp-post-type-widget/webfiles/Base/MMWCPTWD_SettingsLinks.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'rsCustomPost\\Base\\MMWCPTWD_BaseController' not found in wp-content/plugins/wp-post-type-widget/webfiles/Base/MMWCPTWD_PostTypeController.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'rsCustomPost\\Base\\MMWCPTWD_BaseController' not found in wp-content/plugins/wp-post-type-widget/webfiles/Api/Callbacks/MMWCPTWD_ManagerCallbacks.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'rsCustomPost\\Base\\MMWCPTWD_BaseController' not found in wp-content/plugins/wp-post-type-widget/webfiles/Api/Callbacks/MMWCPTWD_AdminCallbacks.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'rsCustomPost\\Base\\MMWCPTWD_BaseController' not found in wp-content/plugins/wp-post-type-widget/webfiles/Base/MMWCPTWD_Enqueue.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'rsCustomPost\\Base\\MMWCPTWD_BaseController' not found in wp-content/plugins/wp-post-type-widget/webfiles/Pages/MMWCPTWD_Dashboard.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-post-type-widget/templates/admin/admin.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'rsCustomPost\\Base\\MMWCPTWD_BaseController' not found in wp-content/plugins/wp-post-type-widget/webfiles/Base/MMWCPTWD_CommonController.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'rsCustomPost\\Base\\MMWCPTWD_BaseController' not found in wp-content/plugins/wp-post-type-widget/webfiles/Base/MMWCPTWD_TaxonomyController.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'rsCustomPost\\Base\\MMWCPTWD_BaseController' not found in wp-content/plugins/wp-post-type-widget/webfiles/Base/MMWCPTWD_WidgetController.php:17

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 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Donate link: Invalid URI ("")
  • Requires at least: Version format is invalid
You can look at the official readme.txt

wp-post-type-widget/mmwcptwd.php 85% from 13 tests

The entry point to "WP Post Type & Widget" version 1.0.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-post-type-widget.php" instead of "mmwcptwd.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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 plugin8,771 lines of code in 51 files:
LanguageFilesBlank linesComment linesLines of code
SVG2002,959
PHP333742742,557
CSS61182,346
JavaScript614077740
JSON300155
Sass12014

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.43
Average class complexity12.25
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity3.27
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes15.00%
Methods100
▷ Static methods88.00%
▷ Public methods9898.00%
▷ Protected methods00.00%
▷ Private methods22.00%
Functions9
▷ Named functions888.89%
▷ Anonymous functions111.11%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/table-no-data.png4.24KB1.99KB▼ 53.14%