10% cpt-calender-widget

Code Review | CPT Calender Widget for WordPress

WordPress plugin CPT Calender Widget for WordPress scored 10% from 54 tests.

About plugin

  • Plugin page: cpt-calender-widget
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.3.1
  • WordPress version: 5.8.1
  • First release: Sep 24, 2015
  • Latest release: Sep 24, 2015
  • Number of updates: 6
  • Update frequency: every 2.8 days
  • Top authors: Hemant Ahir (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

400+ active / 8,384 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/cpt-calender-widget/cpt-calendar-widget.php+17
    Methods with the same name as their class will not be constructors in a future version of PHP; hmt_cpt_calender has a deprecated constructor

Server metrics [RAM: ▼1.78MB] [CPU: ▼195.81ms] Passed 4 tests

A check of server-side resources used by CPT Calender Widget for WordPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /1.85 ▼0.995.05 ▼39.87
Dashboard /wp-admin1.87 ▼1.195.65 ▼43.52
Posts /wp-admin/edit.php1.87 ▼1.246.92 ▼45.78
Add New Post /wp-admin/post-new.php1.87 ▼3.575.45 ▼654.05
Media Library /wp-admin/upload.php1.87 ▼1.144.91 ▼26.93

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 1 new option
New WordPress options
widget_hmt_cpt_calender

Browser metrics Passed 4 tests

A check of browser resources used by CPT Calender Widget for WordPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲13116.36 ▲0.757.89 ▼1.5846.67 ▼8.71
Dashboard /wp-admin2,973 ▲425.88 ▼0.10136.42 ▼21.54114.12 ▼1.27
Posts /wp-admin/edit.php2,739 ▼02.69 ▲0.0063.63 ▼7.9593.69 ▼3.17
Add New Post /wp-admin/post-new.php1,872 ▲28119.18 ▲0.67382.39 ▼14.22107.97 ▼2.05
Media Library /wp-admin/upload.php1,804 ▲564.99 ▲0.01147.13 ▼6.70115.42 ▼13.77

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/cpt-calender-widget/cpt-calendar-widget.php+17
    Methods with the same name as their class will not be constructors in a future version of PHP; hmt_cpt_calender has a deprecated constructor
  • Zombie WordPress options were found after uninstall: 1 option
    • widget_hmt_cpt_calender

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/cpt-calender-widget/cpt-calendar-widget.php:17

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

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (Calander Widget in widget list,drag and drop), #2 (Select CPT from dropdown), #3 (Front side view), #4 (Search result)
Please take inspiration from this readme.txt

cpt-calender-widget/cpt-calendar-widget.php 77% from 13 tests

The main file in "CPT Calender Widget for WordPress" v. 1.0.0 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:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: The principal plugin file should be the same as the plugin slug ("cpt-calender-widget.php" instead of "cpt-calendar-widget.php")
  • Description: The description should be shorter than 140 characters (currently 151 characters long)

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
No dangerous file extensions were detected249 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP15327249

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.12MB with 0.07MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png28.46KB11.34KB▼ 60.17%
screenshot-3.png31.69KB11.46KB▼ 63.86%
screenshot-4.png55.03KB26.10KB▼ 52.56%
screenshot-1.png10.26KB5.16KB▼ 49.70%