89% postpage-edit-restriction-days

Code Review | Post/Page Edit Restriction Days

WordPress plugin Post/Page Edit Restriction Days scored89%from 54 tests.

About plugin

  • Plugin page: postpage-edit-res...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.4
  • WordPress version: 6.3.1
  • First release: Jul 10, 2020
  • Latest release: Jul 18, 2020
  • Number of updates: 7
  • Update frequency: every 1.1 days
  • Top authors: josefnamin (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /429 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼7.58ms] Passed 4 tests

An overview of server-side resources used by Post/Page Edit Restriction Days
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0733.67 ▼13.20
Dashboard /wp-admin3.37 ▲0.0643.67 ▼4.10
Posts /wp-admin/edit.php3.48 ▲0.1349.19 ▲2.16
Add New Post /wp-admin/post-new.php5.97 ▲0.0881.13 ▼12.03
Media Library /wp-admin/upload.php3.29 ▲0.0635.68 ▼0.99

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

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

Browser metrics Passed 4 tests

Post/Page Edit Restriction Days: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,869 ▲12313.58 ▲0.321.62 ▼3.0138.10 ▼4.01
Dashboard /wp-admin2,275 ▲875.43 ▼0.48120.16 ▲16.5442.49 ▲3.13
Posts /wp-admin/edit.php2,174 ▲852.37 ▲0.3749.12 ▲12.0834.47 ▲0.71
Add New Post /wp-admin/post-new.php1,562 ▲4823.44 ▲5.93665.07 ▼19.5134.35 ▼25.44
Media Library /wp-admin/upload.php1,460 ▲754.73 ▲0.48101.43 ▼2.5940.26 ▼2.72

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed: The official readme.txt is a good inspiration

postpage-edit-restriction-days/days-restriction.php 77% from 13 tests

The main file in "Post/Page Edit Restriction Days" v. 1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 559 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: The principal plugin file should be the same as the plugin slug ("postpage-edit-restriction-days.php" instead of "days-restriction.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected376 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP324129242
JavaScript11368
CSS10066

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity29.00
▷ Minimum class complexity29.00
▷ Maximum class complexity29.00
Average method complexity3.15
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin