84% photoshelter-importer

Code Review | PhotoShelter Importer

WordPress plugin PhotoShelter Importer scored84%from 54 tests.

About plugin

  • Plugin page: photoshelter-impo...
  • Plugin version: 1.0.5
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4
  • WordPress version: 6.3.1
  • First release: Jul 31, 2020
  • Latest release: Oct 18, 2023
  • Number of updates: 11
  • Update frequency: every 107.5 days
  • Top authors: photoshelter (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,302 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.29ms] Passed 4 tests

Server-side resources used by PhotoShelter Importer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.12 ▲1.98
Dashboard /wp-admin3.33 ▼0.0258.41 ▼0.02
Posts /wp-admin/edit.php3.38 ▲0.0248.44 ▼1.99
Add New Post /wp-admin/post-new.php5.92 ▲0.0396.93 ▲0.61
Media Library /wp-admin/upload.php3.25 ▲0.0236.80 ▼3.75
PS Importer /wp-admin/options-general.php?page=photoshelter-importer-settings3.2229.49

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

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

Browser metrics Passed 4 tests

Checking browser requirements for PhotoShelter Importer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.36 ▲0.011.80 ▲0.2243.51 ▲2.71
Dashboard /wp-admin2,201 ▲205.63 ▼0.0886.24 ▼17.2941.71 ▼1.12
Posts /wp-admin/edit.php2,103 ▲31.99 ▼0.0433.19 ▼7.8835.30 ▼6.59
Add New Post /wp-admin/post-new.php6,211 ▲4,67619.26 ▲0.88914.24 ▲247.6847.19 ▼25.78
Media Library /wp-admin/upload.php1,409 ▲94.19 ▼0.0194.15 ▼19.3344.34 ▼3.83
PS Importer /wp-admin/options-general.php?page=photoshelter-importer-settings8112.0323.9026.47

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 fix the following
  • 10× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'PhotoShelter\\Importer\\API\\RemoteSource' not found in wp-content/plugins/photoshelter-importer/includes/classes/API/OAuth/DataSource.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PhotoShelter\\Importer\\API\\ClientRemote' not found in wp-content/plugins/photoshelter-importer/includes/classes/API/OAuth/Client.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PhotoShelter\\Importer\\API\\ClientRemote' not found in wp-content/plugins/photoshelter-importer/includes/classes/API/Media/Client.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PhotoShelter\\Importer\\API\\RemoteSource' not found in wp-content/plugins/photoshelter-importer/includes/classes/API/User/DataSource.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PhotoShelter\\Importer\\API\\RemoteSource' not found in wp-content/plugins/photoshelter-importer/includes/classes/API/Media/DataSource.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PhotoShelter\\Importer\\APIv3\\ClientRemote' not found in wp-content/plugins/photoshelter-importer/includes/classes/APIv3/Organization/Client.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PhotoShelter\\Importer\\API\\RemoteSource' not found in wp-content/plugins/photoshelter-importer/includes/classes/API/Auth/DataSource.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PhotoShelter\\Importer\\API\\ClientRemote' not found in wp-content/plugins/photoshelter-importer/includes/classes/API/Auth/Client.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PhotoShelter\\Importer\\APIv3\\RemoteSource' not found in wp-content/plugins/photoshelter-importer/includes/classes/APIv3/Organization/DataSource.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PhotoShelter\\Importer\\API\\ClientRemote' not found in wp-content/plugins/photoshelter-importer/includes/classes/API/User/Client.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention: Please take inspiration from this readme.txt

photoshelter-importer/photoshelter-importer.php Passed 13 tests

The main file in "PhotoShelter Importer" v. 1.0.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
62 characters long description:
PhotoShelter Digital Asset Manager integration with WordPress.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin2,596 lines of code in 59 files:
LanguageFilesBlank linesComment linesLines of code
PHP203538451,546
SVG3220231,043
CSS4004
JavaScript3033

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity2.71
▷ Minimum class complexity1.00
▷ Maximum class complexity8.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces13
Interfaces0
Traits0
Classes14
▷ Abstract classes428.57%
▷ Concrete classes1071.43%
▷ Final classes00.00%
Methods34
▷ Static methods00.00%
▷ Public methods2676.47%
▷ Protected methods823.53%
▷ Private methods00.00%
Functions47
▷ Named functions4595.74%
▷ Anonymous functions24.26%
Constants17
▷ Global constants17100.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
5 PNG files occupy 0.29MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
.wordpress-org/icon-128x128.png10.26KB3.72KB▼ 63.74%
.wordpress-org/screenshot-4.png106.53KB29.51KB▼ 72.30%
.wordpress-org/icon-256x256.png31.03KB6.55KB▼ 78.89%
.wordpress-org/screenshot-5.png104.75KB37.99KB▼ 63.74%
.wordpress-org/screenshot-3.png40.84KB16.48KB▼ 59.64%