74% photoprism

Code Review | Photo Prism

WordPress plugin Photo Prism scored74%from 54 tests.

About plugin

  • Plugin page: photoprism
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.5.3
  • WordPress version: 6.3.1
  • First release: Nov 30, 2020
  • Latest release: Nov 30, 2020
  • Number of updates: 3
  • Update frequency: every 1.7 days
  • Top authors: jseals (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /410 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.87MB] [CPU: ▼32.96ms] Passed 4 tests

An overview of server-side resources used by Photo Prism
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0941.98 ▼0.91
Dashboard /wp-admin3.07 ▼0.2326.52 ▼22.21
Posts /wp-admin/edit.php3.07 ▼0.2826.53 ▼22.25
Add New Post /wp-admin/post-new.php3.07 ▼2.8126.58 ▼78.69
Media Library /wp-admin/upload.php3.07 ▼0.1626.92 ▼8.67

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 14 new files
Database: 1 new table, 9 new options
New tables
wp_photo_table
New WordPress options
can_compress_scripts
SP_text_1
widget_recent-comments
ps_myphoto_page_id
widget_recent-posts
widget_theysaidso_widget
SP_text_2
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Photo Prism
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,974 ▲21314.15 ▼0.387.35 ▲5.4424.62 ▼20.78
Dashboard /wp-admin2,213 ▲364.92 ▼0.7386.55 ▼6.6696.30 ▲54.85
Posts /wp-admin/edit.php2,136 ▲362.32 ▲0.3239.33 ▲0.3252.12 ▲17.27
Add New Post /wp-admin/post-new.php1,712 ▲18122.88 ▼0.22792.38 ▲117.1061.26 ▲8.38
Media Library /wp-admin/upload.php1,424 ▲244.48 ▲0.27108.28 ▲2.3592.44 ▲49.69

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/photoprism/pp-photo-prism.php+369
    Undefined index: action
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Please take a closer look at the following
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/photoprism/pp-photo-prism.php
    • > /wp-content/plugins/photoprism/inc/database.php
    • > /wp-content/plugins/photoprism/views/myphoto.php

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

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: photo vault, photo, photography

photoprism/pp-photo-prism.php 92% from 13 tests

The main PHP file in "Photo Prism" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("photoprism.php" instead of "pp-photo-prism.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin824 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP513045597
CSS2319143
JavaScript28684

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Functions25
▷ Named functions2184.00%
▷ Anonymous functions416.00%
Constants3
▷ Global constants3100.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
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/icon-check.png2.13KB1.45KB▼ 32.17%
img/photo-icon-km-old.png8.29KB4.78KB▼ 42.32%
img/photo-icon-km.png1.41KB0.87KB▼ 38.70%