78% prophoto-light-blue-api-add-on

Code Review | Light Blue API for ProPhoto Plug-in

WordPress plugin Light Blue API for ProPhoto Plug-in scored78%from 54 tests.

About plugin

  • Plugin page: prophoto-light-bl...
  • Plugin version: 1.0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.1
  • WordPress version: 6.3.1
  • First release: May 30, 2014
  • Latest release: Mar 11, 2019
  • Number of updates: 12
  • Update frequency: every 145.6 days
  • Top authors: TomCatchesides (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,405 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼10.93ms] Passed 4 tests

Analyzing server-side resources used by Light Blue API for ProPhoto Plug-in
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0433.20 ▼4.90
Dashboard /wp-admin3.36 ▲0.0144.88 ▼18.53
Posts /wp-admin/edit.php3.41 ▲0.0548.90 ▲3.99
Add New Post /wp-admin/post-new.php5.94 ▲0.0578.69 ▼21.29
Media Library /wp-admin/upload.php3.28 ▲0.0534.28 ▲1.00
Light Blue / ProPhoto /wp-admin/options-general.php?page=light_blue_pro_photo_settings3.2228.93

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
recovery_mode_email_last_sent
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Light Blue API for ProPhoto Plug-in
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲4013.29 ▼1.081.58 ▼0.6337.73 ▼5.97
Dashboard /wp-admin2,217 ▲295.90 ▲1.00101.94 ▼10.7941.70 ▼4.15
Posts /wp-admin/edit.php2,103 ▲141.97 ▼0.0135.62 ▼0.4137.91 ▲2.83
Add New Post /wp-admin/post-new.php1,428 ▼8621.97 ▲4.40562.67 ▼116.2329.67 ▼15.29
Media Library /wp-admin/upload.php1,399 ▲144.29 ▲0.0895.27 ▼4.4239.20 ▼8.78
Light Blue / ProPhoto /wp-admin/options-general.php?page=light_blue_pro_photo_settings7911.538.1530.67

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 7 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • recovery_mode_email_last_sent
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=light_blue_pro_photo_settings
    • > Notice in wp-content/plugins/prophoto-light-blue-api-add-on/prophoto-light-blue-api.php+141
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=light_blue_pro_photo_settings
    • > Error in wp-content/plugins/prophoto-light-blue-api-add-on/prophoto-light-blue-api.php+266
    Uncaught Error: Class 'pp' not found in wp-content/plugins/prophoto-light-blue-api-add-on/prophoto-light-blue-api.php:266
    Stack trace:
    #0 wp-content/plugins/prophoto-light-blue-api-add-on/prophoto-light-blue-api.php(188): PPLightBlueAPI::construct_field_selector()
    #1 wp-includes/class-wp-hook.php(310): PPLightBlueAPI::lb_settings_page()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #6 {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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/prophoto-light-blue-api-add-on/prophoto-light-blue-api.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (The Light Blue API for ProPhoto Plug-in settings page) image not found
You can take inspiration from this readme.txt

prophoto-light-blue-api-add-on/prophoto-light-blue-api.php 92% from 13 tests

The main file in "Light Blue API for ProPhoto Plug-in" v. 1.0.9 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("prophoto-light-blue-api-add-on.php" instead of "prophoto-light-blue-api.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin265 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP16729265

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity42.00
▷ Minimum class complexity42.00
▷ Maximum class complexity42.00
Average method complexity6.12
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods8100.00%
▷ Public methods8100.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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.16MB with 0.11MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png164.20KB49.29KB▼ 69.98%