83% custom-post-type-date-archives

Code Review | Custom Post Type Date Archives

WordPress plugin Custom Post Type Date Archives scored83%from 54 tests.

About plugin

  • Plugin page: custom-post-type-...
  • Plugin version: 2.7.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.5
  • WordPress version: 6.3.1
  • First release: Mar 9, 2016
  • Latest release: Aug 13, 2020
  • Number of updates: 39
  • Update frequency: every 41.5 days
  • Top authors: keesiemeijer (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

2,000+ active /19,666 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼2.28MB] [CPU: ▼524,961.36ms] Passed 4 tests

A check of server-side resources used by Custom Post Type Date Archives
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.99 ▲0.4846.50 ▲4.75
Dashboard /wp-admin3.81 ▼10.4154.75 ▼2,099,834.89
Posts /wp-admin/edit.php3.87 ▲0.4753.92 ▲2.64
Add New Post /wp-admin/post-new.php6.36 ▲0.4392.25 ▼17.94
Media Library /wp-admin/upload.php3.67 ▲0.4044.16 ▲5.77

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Custom Post Type Date Archives
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.23 ▼0.121.56 ▼0.1737.39 ▼3.58
Dashboard /wp-admin2,192 ▲125.51 ▼0.1685.08 ▼6.2441.40 ▼0.90
Posts /wp-admin/edit.php2,100 ▼01.96 ▼0.0536.58 ▼2.8036.60 ▲2.65
Add New Post /wp-admin/post-new.php6,199 ▲4,67326.30 ▲3.13949.17 ▲261.2356.91 ▼3.02
Media Library /wp-admin/upload.php1,397 ▼34.17 ▼0.06102.16 ▲1.2845.25 ▲0.43

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 13× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/custom-post-type-date-archives/includes/partials/admin-info.php:3
    • > PHP Notice
      Undefined variable: recent_posts in wp-content/plugins/custom-post-type-date-archives/includes/partials/latest-posts-block-display.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/custom-post-type-date-archives/includes/widgets/class-cptda-widget-calendar.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/custom-post-type-date-archives/includes/widgets/class-cptda-widget-recent-posts.php:19
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/custom-post-type-date-archives/includes/partials/recent-posts-display.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/custom-post-type-date-archives/includes/partials/admin-error.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/custom-post-type-date-archives/includes/partials/calendar-widget.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/custom-post-type-date-archives/includes/partials/recent-posts-widget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/custom-post-type-date-archives/includes/partials/admin-help.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/custom-post-type-date-archives/includes/partials/archive-widget.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: post type, archives, date, events, calendar

custom-post-type-date-archives/custom-post-type-date-archives.php 77% from 13 tests

The main PHP script in "Custom Post Type Date Archives" version 2.7.1 is automatically included on every request by WordPress
The following require your attention:
  • Domain Path: You should use only dashes and lowercase characters for the domain path ("languages")
  • Domain Path: Prefix the domain path with a forward slash character ("/languages")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 142 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected2,586 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PHP356611,7342,567
CSS14015
JavaScript1034

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity13.25
▷ Minimum class complexity8.00
▷ Maximum class complexity23.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes18.33%
Methods88
▷ Static methods11.14%
▷ Public methods6573.86%
▷ Protected methods00.00%
▷ Private methods2326.14%
Functions46
▷ Named functions46100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
There are no PNG files in this plugin