78% extensions-for-pressbooks

Code Review | Extensions for PressBooks

WordPress plugin Extensions for PressBooks scored78%from 54 tests.

About plugin

  • Plugin page: extensions-for-pr...
  • Plugin version: 1.2.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2.2
  • WordPress version: 6.3.1
  • First release: Mar 6, 2020
  • Latest release: Mar 6, 2020
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: colomet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /536 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.00MB] [CPU: ▼8.23ms] Passed 4 tests

Server-side resources used by Extensions for PressBooks
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.09 ▼7.88
Dashboard /wp-admin3.31 ▲0.0048.21 ▼2.33
Posts /wp-admin/edit.php3.36 ▲0.0052.39 ▼0.13
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.69 ▼21.19
Media Library /wp-admin/upload.php3.23 ▲0.0035.53 ▼1.50

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Extensions for PressBooks
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.23 ▼1.331.72 ▼0.3140.88 ▼4.89
Dashboard /wp-admin2,200 ▲125.78 ▲0.86103.77 ▼6.1640.87 ▲0.80
Posts /wp-admin/edit.php2,089 ▼02.02 ▼0.1142.75 ▲1.0737.33 ▼0.67
Add New Post /wp-admin/post-new.php1,533 ▼923.14 ▲4.94673.42 ▲51.7058.26 ▲7.03
Media Library /wp-admin/upload.php1,391 ▲34.19 ▼0.0496.00 ▼9.8043.82 ▲1.18

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/extensions-for-pressbooks/admin/efpb-admin-settings.php
    • > /wp-content/plugins/extensions-for-pressbooks/extensions-for-pressbooks.php
    • > /wp-content/plugins/extensions-for-pressbooks/post-metabox-pb_is_based_on/efpb-post-metabox-pb_is_based_on.php
    • > /wp-content/plugins/extensions-for-pressbooks/network-admin/efpb-network-admin.php
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/extensions-for-pressbooks/default/efpb-default-theme.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/extensions-for-pressbooks/admin/efpb-theme-customizations.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/extensions-for-pressbooks/original-mark/efpb-original-mark.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_plugin_active() in wp-content/plugins/extensions-for-pressbooks/canonical/efpb-canonical.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/extensions-for-pressbooks/default/efpb-default-permalinks.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/extensions-for-pressbooks/default/efpb-default-settings.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/extensions-for-pressbooks/post/efpb-post.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/extensions-for-pressbooks/groupByLanguage/efpb-groupByLanguage.php:18

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

readme.txt 94% from 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
These attributes need your attention: You can look at the official readme.txt

extensions-for-pressbooks/extensions-for-pressbooks.php 92% from 13 tests

The main PHP file in "Extensions for PressBooks" ver. 1.2.8 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected453 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP13100362429
JavaScript10024

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.32
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%
Functions27
▷ Named functions2696.30%
▷ Anonymous functions13.70%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin