10% photography-portfolio

Code Review | Easy Photography Portfolio

WordPress plugin Easy Photography Portfolio scored 10% from 54 tests.

About plugin

  • Plugin page: photography-portf...
  • Plugin version: 1.5.1
  • PHP compatiblity: 5.4.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-5.6.2
  • WordPress version: 6.3.1
  • First release: Nov 30, 2016
  • Latest release: Feb 27, 2021
  • Number of updates: 103
  • Update frequency: every 15.0 days
  • Top authors: justnorris (85.44%)pyronaur (11.65%)colormelon (4.85%)

Code review

54 tests

User reviews

30 reviews

Install metrics

4,000+ active / 114,439 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • This plugin did not install gracefully
    • > User deprecated in wp-includes/functions.php+5453
    Function get_page_by_title is deprecated since version 6.2.0! Use WP_Query instead.

Server metrics [RAM: ▲1.04MB] [CPU: ▲4.92ms] Passed 4 tests

A check of server-side resources used by Easy Photography Portfolio
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.21 ▲0.7640.93 ▼1.87
Dashboard /wp-admin4.45 ▲1.1556.13 ▲6.96
Posts /wp-admin/edit.php4.48 ▲1.1258.14 ▲13.01
Add New Post /wp-admin/post-new.php7.11 ▲1.2295.25 ▲1.56
Media Library /wp-admin/upload.php4.38 ▲1.1550.39 ▲17.21
All Entries /wp-admin/edit.php?post_type=phort_post4.4652.90
Categories /wp-admin/edit-tags.php?taxonomy=phort_post_category&post_type=phort_post4.3743.89
New Portfolio Entry /wp-admin/post-new.php?post_type=phort_post7.3993.35
Portfolio Settings /wp-admin/edit.php?post_type=phort_post&page=phort_options4.7447.03

Server storage [IO: ▲3.65MB] [DB: ▲0.08MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 472 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
phort_options
phort_sample_post
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Easy Photography Portfolio
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,949 ▲19213.37 ▼1.001.67 ▼0.7135.63 ▼18.90
Dashboard /wp-admin2,276 ▲885.02 ▲0.15113.33 ▼6.4146.50 ▼2.30
Posts /wp-admin/edit.php2,162 ▲732.17 ▲0.1342.63 ▲6.3939.45 ▲3.61
Add New Post /wp-admin/post-new.php1,572 ▲3023.24 ▲0.03596.38 ▼17.0262.76 ▲7.38
Media Library /wp-admin/upload.php1,495 ▲1074.50 ▲0.30106.72 ▲3.6945.85 ▲4.06
All Entries /wp-admin/edit.php?post_type=phort_post1,7182.1440.5637.59
Categories /wp-admin/edit-tags.php?taxonomy=phort_post_category&post_type=phort_post1,3342.5030.7332.78
New Portfolio Entry /wp-admin/post-new.php?post_type=phort_post6,46021.17903.2134.82
Portfolio Settings /wp-admin/edit.php?post_type=phort_post&page=phort_options1,2672.3427.5043.10

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • phort_sample_post
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • phort_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/photography-portfolio/public/templates/gallery/item/video.php
    • > /wp-content/plugins/photography-portfolio/public/templates/gallery/item/image.php
  • 73× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller' not found in wp-content/plugins/photography-portfolio/vendor/webdevstudios/cmb2/includes/rest-api/CMB2_REST_Controller_Boxes.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/photography-portfolio/vendor/webdevstudios/cmb2/includes/types/CMB2_Type_File_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Photography_Portfolio\\Frontend\\Popup_Gallery\\Abstract_Popup_Gallery' not found in wp-content/plugins/photography-portfolio/Photography_Portfolio/Frontend/Popup_Gallery/lightGallery.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/photography-portfolio/public/templates/partials/wrapper-start.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/photography-portfolio/vendor/webdevstudios/cmb2/includes/types/CMB2_Type_Taxonomy_Multicheck.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/photography-portfolio/vendor/webdevstudios/cmb2/includes/types/CMB2_Type_Checkbox.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller_Boxes' not found in wp-content/plugins/photography-portfolio/vendor/webdevstudios/cmb2/includes/rest-api/CMB2_REST_Controller_Fields.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Radio' not found in wp-content/plugins/photography-portfolio/vendor/webdevstudios/cmb2/includes/types/CMB2_Type_Taxonomy_Radio_Hierarchical.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function phort_get_template() in wp-content/plugins/photography-portfolio/public/templates/single-portfolio.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Photography_Portfolio\\Frontend\\Layout\\Single\\Single_Portfolio_Layout' not found in wp-content/plugins/photography-portfolio/Photography_Portfolio/Frontend/Layout/Single/Masonry/Single_Column_Layout.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% 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:
  • Tags: Please reduce the number of tags, currently 28 tag instead of maximum 10
The official readme.txt might help

photography-portfolio/photography-portfolio.php Passed 13 tests

The primary PHP file in "Easy Photography Portfolio" version 1.5.1 is used by WordPress to initiate all plugin functionality
119 characters long description:
Add a photography portfolio to any WordPress theme. Designed for Photographers, yet made with theme developers in mind.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin59,538 lines of code in 311 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP1353,8987,95310,289
CSS173451,2945,471
JavaScript131,3351,0794,900
JSON4004,351
Sass17306291,410
Markdown32410746
SVG20048

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity14.54
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces16
Interfaces2
Traits1
Classes105
▷ Abstract classes1211.43%
▷ Concrete classes9388.57%
▷ Final classes00.00%
Methods741
▷ Static methods11916.06%
▷ Public methods63585.70%
▷ Protected methods9512.82%
▷ Private methods111.48%
Functions94
▷ Named functions8489.36%
▷ Anonymous functions1010.64%
Constants15
▷ Global constants960.00%
▷ Class constants640.00%
▷ Public constants6100.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
18 compressed PNG files occupy 0.04MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/build/img/photoswipe/default-skin.png0.53KB0.72KB0.00%
vendor/webdevstudios/cmb2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
public/build/img/vimeo-play.png5.30KB1.56KB▼ 70.65%
vendor/webdevstudios/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
vendor/webdevstudios/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%