89% bu-versions

Code Review | BU Versions

WordPress plugin BU Versions scored 89% from 54 tests.

About plugin

  • Plugin page: bu-versions
  • Plugin version: 0.7.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.6.1
  • WordPress version: 5.8.1
  • First release: Mar 12, 2013
  • Latest release: Sep 19, 2016
  • Number of updates: 23
  • Update frequency: every 56.6 days
  • Top authors: bostonu (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

100+ active / 4,414 total downloads

Benchmarks

Plugin footprint Passed 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.28MB] [CPU: ▼144.03ms] Passed 4 tests

An overview of server-side resources used by BU Versions
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.05 ▲0.3338.27 ▲16.75
Dashboard /wp-admin3.37 ▲0.3242.44 ▲0.44
Posts /wp-admin/edit.php3.42 ▲0.3244.79 ▼1.60
Add New Post /wp-admin/post-new.php5.67 ▲0.2389.83 ▼566.48
Media Library /wp-admin/upload.php3.25 ▲0.2526.54 ▼8.49
Alternate Pages /wp-admin/edit.php?post_type=page_alt3.2935.47
Alternate Reusable blocks /wp-admin/edit.php?post_type=wp_block_alt3.2934.36
/wp-admin/admin.php?page=bu_create_version3.1323.37
Alternate Posts /wp-admin/edit.php?post_type=post_alt3.2932.89

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 19 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

BU Versions: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,697 ▲10116.30 ▲0.807.77 ▼0.2244.13 ▼2.36
Dashboard /wp-admin2,985 ▲486.11 ▲0.08139.31 ▼13.04109.74 ▼0.61
Posts /wp-admin/edit.php2,782 ▲432.71 ▲0.0065.68 ▼1.8296.24 ▲1.63
Add New Post /wp-admin/post-new.php1,628 ▼5522.09 ▲3.35259.31 ▼100.11103.94 ▼6.56
Media Library /wp-admin/upload.php1,828 ▲775.07 ▲0.05154.54 ▲0.45113.09 ▼5.60
Alternate Pages /wp-admin/edit.php?post_type=page_alt1,4242.6562.8076.71
Alternate Reusable blocks /wp-admin/edit.php?post_type=wp_block_alt1,4142.6361.9075.82
/wp-admin/admin.php?page=bu_create_version1,0012.3453.3661.24
Alternate Posts /wp-admin/edit.php?post_type=post_alt1,4242.6264.7674.48

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=bu_create_version
    • > Notice in wp-content/plugins/bu-versions/bu-versions.php+816
    Undefined index: _wpnonce

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/bu-versions/tests/bootstrap.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bu-versions/bu-versions.php:104
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/bu-versions/tests/test-bu-versions-meta.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/bu-versions/tests/test-bu-versions.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/bu-versions/interface/page-template.php:1
    • > PHP Warning
      require_once(/tmp/wordpress-tests-lib/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/bu-versions/tests/bootstrap.php on line 15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: bu, content editing, merge, version, workflow...

bu-versions/bu-versions.php Passed 13 tests

The entry point to "BU Versions" version 0.7.8 is a PHP file that has certain tags in its header comment area
43 characters long description:
Make and review edits to published content.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected1,226 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP63031741,036
Bourne Shell121685
CSS112839
JSON10023
JavaScript13316
XML10014
YAML15013

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity18.30
▷ Minimum class complexity3.00
▷ Maximum class complexity59.00
Average method complexity3.04
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods85
▷ Static methods44.71%
▷ Public methods8397.65%
▷ Protected methods00.00%
▷ Private methods22.35%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.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
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/page_copy.png0.65KB0.91KB0.00%
images/page_edit.png3.36KB0.91KB▼ 73.03%
images/pages_alt.png2.05KB1.06KB▼ 48.43%
images/posts_alt.png2.34KB1.26KB▼ 45.88%