72% bolt-media-wp-integration

Code Review | Bolt Platform Integration

WordPress plugin Bolt Platform Integration scored72%from 54 tests.

About plugin

  • Plugin page: bolt-media-wp-int...
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-3.4
  • WordPress version: 6.3.1
  • First release: Mar 22, 2017
  • Latest release: Apr 25, 2017
  • Number of updates: 10
  • Update frequency: every 3.1 days
  • Top authors: boltmedia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /545 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.09MB] [CPU: ▼7.38ms] Passed 4 tests

Server-side resources used by Bolt Platform Integration
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0940.25 ▼2.38
Dashboard /wp-admin3.40 ▲0.0647.22 ▼13.20
Posts /wp-admin/edit.php3.52 ▲0.1645.11 ▼5.98
Add New Post /wp-admin/post-new.php5.98 ▲0.1082.35 ▼7.95
Media Library /wp-admin/upload.php3.33 ▲0.1035.75 ▲2.09
Bolt Media Apps /wp-admin/users.php?page=bolt-app-admin3.2124.70

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-comments
recovery_mode_email_last_sent
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Bolt Platform Integration: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲8014.35 ▲0.121.87 ▼0.1039.64 ▼5.12
Dashboard /wp-admin2,204 ▲305.49 ▼0.0986.29 ▼23.0737.35 ▼7.73
Posts /wp-admin/edit.php2,115 ▲152.01 ▼0.0236.88 ▼8.7538.90 ▼1.24
Add New Post /wp-admin/post-new.php1,545 ▲1918.00 ▼4.88629.11 ▼11.6684.95 ▲30.14
Media Library /wp-admin/upload.php1,415 ▲124.17 ▼0.0396.74 ▼7.8142.63 ▼8.30
Bolt Media Apps /wp-admin/users.php?page=bolt-app-admin450.420.078.94

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • recovery_mode_email_last_sent
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 25% 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 errors were triggered by the plugin
    • > GET request to /wp-admin/users.php?page=bolt-app-admin
    • > User deprecated in wp-includes/functions.php+5453
    Function get_page_by_title is deprecated since version 6.2.0! Use WP_Query instead.
    • > GET request to /wp-admin/users.php?page=bolt-app-admin
    • > Notice in wp-content/plugins/bolt-media-wp-integration/lib/class-wp-bolt-admin.php+83
    Trying to get property 'ID' of non-object
    • > GET request to /wp-admin/users.php?page=bolt-app-admin
    • > Error in wp-content/plugins/bolt-media-wp-integration/lib/class-wp-bolt-admin.php+100
    Uncaught Error: Class 'WP_REST_OAuth1' not found in wp-content/plugins/bolt-media-wp-integration/lib/class-wp-bolt-admin.php:100
    Stack trace:
    #0 wp-content/plugins/bolt-media-wp-integration/lib/class-wp-bolt-admin.php(87): Bolt_Admin::create_auto_user()
    #1 wp-content/plugins/bolt-media-wp-integration/lib/class-wp-bolt-admin.php(74): Bolt_Admin::check_user()
    #2 wp-includes/class-wp-hook.php(310): Bolt_Admin::load()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/admin.php(237): do_action()
    #6 wp-admin/users.php(11): require_once('/var/www/wordpr...')
    #7 {main}
    thrown

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
The following issues need your attention
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/bolt-media-wp-integration/index.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/bolt-media-wp-integration/lib/function-shortcode.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/bolt-media-wp-integration/lib/class-wp-bolt-listtable.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/users.php?page=bolt-app-admin
    • > Network (severe)
    wp-admin/users.php?page=bolt-app-admin - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention: Please take inspiration from this readme.txt

bolt-media-wp-integration/index.php 92% from 13 tests

Analyzing the main PHP file in "Bolt Platform Integration" version 1.5
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("bolt-media-wp-integration.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected665 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP5151169665

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
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 complexity22.00
▷ Minimum class complexity2.00
▷ Maximum class complexity42.00
Average method complexity3.10
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods30
▷ Static methods1963.33%
▷ Public methods2066.67%
▷ Protected methods1033.33%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants125.00%
▷ Class constants375.00%
▷ Public constants3100.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
There were not PNG files found in your plugin