10% wp-scheduled-read-only

Code Review | WP Scheduled Read-Only

WordPress plugin WP Scheduled Read-Only scored10%from 54 tests.

About plugin

  • Plugin page: wp-scheduled-read...
  • Plugin version: 1.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.8
  • WordPress version: 6.3.1
  • First release: Mar 21, 2014
  • Latest release: Dec 22, 2021
  • Number of updates: 12
  • Update frequency: every 236.2 days
  • Top authors: bastho (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,199 total downloads

Benchmarks

Plugin footprint 40% 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
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/wp-scheduled-read-only/readonly.php+42
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.89MB] [CPU: ▼55.22ms] Passed 4 tests

An overview of server-side resources used by WP Scheduled Read-Only
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.10 ▼1.366.94 ▼39.22
Dashboard /wp-admin2.12 ▼1.197.65 ▼43.48
Posts /wp-admin/edit.php2.12 ▼1.248.78 ▼42.56
Add New Post /wp-admin/post-new.php2.12 ▼3.778.36 ▼95.61
Media Library /wp-admin/upload.php2.12 ▼1.116.59 ▼31.23
Read Only /wp-admin/options-general.php?page=wp_readonly_configuration2.127.87

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Scheduled Read-Only
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3314.48 ▲0.131.88 ▼0.4044.13 ▼3.87
Dashboard /wp-admin2,210 ▲225.83 ▼0.06101.12 ▲1.0938.05 ▼10.84
Posts /wp-admin/edit.php2,090 ▲12.02 ▲0.0239.13 ▲4.0034.16 ▼6.43
Add New Post /wp-admin/post-new.php1,414 ▼10017.96 ▲0.37613.63 ▼90.1155.29 ▼1.69
Media Library /wp-admin/upload.php1,392 ▲44.19 ▼0.0396.35 ▼17.4243.87 ▼5.20
Read Only /wp-admin/options-general.php?page=wp_readonly_configuration8822.0325.0624.16

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
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/wp-scheduled-read-only/readonly.php+42
    Trying to access array offset on value of type bool
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp_readonly_configuration
    • > Notice in wp-content/plugins/wp-scheduled-read-only/readonly.php+44
    Trying to access array offset on value of type bool

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
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-scheduled-read-only/readonly.php on line 14
    • > PHP Warning
      require_once(ABSPATH/wp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/wp-scheduled-read-only/readonly.php on line 14
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-scheduled-read-only/readonly.php on line 14

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

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: readonly, network, comments, multisite, block...

wp-scheduled-read-only/readonly.php 92% from 13 tests

"WP Scheduled Read-Only" version 1.3.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-scheduled-read-only.php" instead of "readonly.php")

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 detected546 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
SVG111307
PHP22414196
PO File1121243

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.55
Average class complexity41.00
▷ Minimum class complexity41.00
▷ Maximum class complexity41.00
Average method complexity3.67
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
_assets/icon.png9.63KB4.19KB▼ 56.48%