83% photo-tools-image-taxonomies

Code Review | PhotoPress - Image Taxonomies

WordPress plugin PhotoPress - Image Taxonomies scored83%from 54 tests.

About plugin

  • Plugin page: photo-tools-image...
  • Plugin version: 1.9.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2.1-4.9.8
  • WordPress version: 6.3.1
  • First release: Dec 27, 2011
  • Latest release: Jun 6, 2020
  • Number of updates: 90
  • Update frequency: every 36.7 days
  • Top authors: padams (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

40+ active /8,411 total downloads

Benchmarks

Plugin footprint 83% 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.24MB] [CPU: ▼8.27ms] Passed 4 tests

Analyzing server-side resources used by PhotoPress - Image Taxonomies
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.05 ▲0.3144.70 ▼8.39
Dashboard /wp-admin3.87 ▲0.2358.36 ▼14.53
Posts /wp-admin/edit.php3.92 ▲0.2451.25 ▼1.28
Add New Post /wp-admin/post-new.php6.38 ▲0.2495.58 ▼8.87
Media Library /wp-admin/upload.php3.73 ▲0.2440.95 ▼0.33
Collections /wp-admin/edit-tags.php?taxonomy=photos_collection&post_type=attachment3.7238.98
States /wp-admin/edit-tags.php?taxonomy=photos_state&post_type=attachment3.7243.87
Cities /wp-admin/edit-tags.php?taxonomy=photos_city&post_type=attachment3.7238.58
Keywords /wp-admin/edit-tags.php?taxonomy=photos_keywords&post_type=attachment3.7237.43
Cameras /wp-admin/edit-tags.php?taxonomy=photos_camera&post_type=attachment3.7236.41
People /wp-admin/edit-tags.php?taxonomy=photos_people&post_type=attachment3.7239.65
Countries /wp-admin/edit-tags.php?taxonomy=photos_country&post_type=attachment3.7237.88
Lenses /wp-admin/edit-tags.php?taxonomy=photos_lens&post_type=attachment3.7241.22
Prints /wp-admin/edit-tags.php?taxonomy=photos_prints&post_type=attachment3.7236.80

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
widget_papt_displaytaxterms
db_upgraded
widget_papt_displayexif
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for PhotoPress - Image Taxonomies
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7914.38 ▲0.081.99 ▲0.0045.30 ▲3.03
Dashboard /wp-admin2,231 ▲545.70 ▲0.0997.81 ▼6.6844.39 ▲2.36
Posts /wp-admin/edit.php2,136 ▲362.08 ▲0.0637.23 ▲0.0932.95 ▼2.96
Add New Post /wp-admin/post-new.php1,572 ▲4623.12 ▼0.27638.28 ▼6.1054.71 ▲5.74
Media Library /wp-admin/upload.php1,436 ▲334.24 ▼0.0198.16 ▼4.4645.06 ▲2.24
Collections /wp-admin/edit-tags.php?taxonomy=photos_collection&post_type=attachment1,2822.1428.7532.72
States /wp-admin/edit-tags.php?taxonomy=photos_state&post_type=attachment1,2852.1430.5932.63
Cities /wp-admin/edit-tags.php?taxonomy=photos_city&post_type=attachment1,2822.1426.7528.74
Keywords /wp-admin/edit-tags.php?taxonomy=photos_keywords&post_type=attachment1,2792.1428.7028.92
Cameras /wp-admin/edit-tags.php?taxonomy=photos_camera&post_type=attachment1,2852.1426.7833.18
People /wp-admin/edit-tags.php?taxonomy=photos_people&post_type=attachment1,2792.1428.1632.75
Countries /wp-admin/edit-tags.php?taxonomy=photos_country&post_type=attachment1,2852.1427.1229.12
Lenses /wp-admin/edit-tags.php?taxonomy=photos_lens&post_type=attachment1,2792.1428.0430.24
Prints /wp-admin/edit-tags.php?taxonomy=photos_prints&post_type=attachment1,2822.1427.3930.65

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_recent-comments
    • widget_papt_displaytaxterms
    • theysaidso_admin_options
    • widget_papt_displayexif
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/photo-tools-image-taxonomies/photopress-image-taxonomies.php:995

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Taxonomy fields added to image attachment form.), #2 (Single Image EXIF Widget and Taxonomy Widget.)
The official readme.txt is a good inspiration

photo-tools-image-taxonomies/photopress-image-taxonomies.php 92% from 13 tests

The main PHP file in "PhotoPress - Image Taxonomies" ver. 1.9.8 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("photo-tools-image-taxonomies.php" instead of "photopress-image-taxonomies.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
No dangerous file extensions were detected1,028 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP64191951,028

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity11.12
▷ Minimum class complexity1.00
▷ Maximum class complexity63.00
Average method complexity2.53
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods53
▷ Static methods11.89%
▷ Public methods53100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.17MB with 0.11MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png39.41KB15.09KB▼ 61.72%
screenshot-1.png133.84KB38.59KB▼ 71.16%