84% arastoo-cpt

Code Review | Arastoo Custom Post Type

WordPress plugin Arastoo Custom Post Type scored84%from 54 tests.

About plugin

  • Plugin page: arastoo-cpt
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.5.3
  • WordPress version: 6.3.1
  • First release: Nov 24, 2020
  • Latest release: Nov 24, 2020
  • Number of updates: 8
  • Update frequency: N/A
  • Top authors: lucenadigital (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /374 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.00MB] [CPU: ▼7.01ms] Passed 4 tests

Analyzing server-side resources used by Arastoo Custom Post Type
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.77 ▼8.10
Dashboard /wp-admin3.31 ▼0.0356.50 ▼9.76
Posts /wp-admin/edit.php3.36 ▲0.0147.60 ▼5.64
Add New Post /wp-admin/post-new.php5.91 ▲0.0393.42 ▼4.53
Media Library /wp-admin/upload.php3.24 ▲0.0141.13 ▲2.10
Arastoo CPT /wp-admin/options-general.php?page=arastoo-cpt3.2033.47

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Arastoo Custom Post Type
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲6014.74 ▲0.162.09 ▲0.3946.18 ▲3.41
Dashboard /wp-admin2,224 ▲214.86 ▼0.01116.99 ▲2.3643.60 ▼3.89
Posts /wp-admin/edit.php2,106 ▲32.03 ▼0.0135.51 ▼0.4136.70 ▼0.25
Add New Post /wp-admin/post-new.php1,536 ▲523.17 ▲0.12644.64 ▼45.0659.53 ▼5.02
Media Library /wp-admin/upload.php1,406 ▲64.27 ▲0.1195.77 ▼11.3542.95 ▼2.71
Arastoo CPT /wp-admin/options-general.php?page=arastoo-cpt8612.0626.3046.65

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not 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
The following issues need your attention
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/arastoo-cpt/parts/cpt-register.php:126
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/arastoo-cpt/arastoo-cpt.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: simple custom post type, custom post type, cpt, easy

arastoo-cpt/arastoo-cpt.php Passed 13 tests

The principal PHP file in "Arastoo Custom Post Type" v. 1.0.2 is loaded by WordPress automatically on each request
78 characters long description:
Smart Plugin that can create upto two Custom Post Type. Settings > Arastoo CPT

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected127 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP32726119
JavaScript1108

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.07
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
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.04MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
arastoo-cpt-options-settings.png40.74KB19.56KB▼ 52.00%