78% fg-gallery

Code Review | Filterable Portfolio Gallery Plugin

WordPress plugin Filterable Portfolio Gallery Plugin scored78%from 54 tests.

About plugin

  • Plugin page: fg-gallery
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Apr 24, 2017
  • Latest release: Apr 24, 2017
  • Number of updates: 35
  • Update frequency: every 0.1 days
  • Top authors: kamig478 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,542 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.06MB] [CPU: ▼7.86ms] Passed 4 tests

This is a short check of server-side resources used by Filterable Portfolio Gallery Plugin
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0838.23 ▼1.95
Dashboard /wp-admin3.38 ▲0.0344.80 ▼20.26
Posts /wp-admin/edit.php3.43 ▲0.0749.65 ▲3.11
Add New Post /wp-admin/post-new.php5.98 ▲0.0991.85 ▼6.97
Media Library /wp-admin/upload.php3.30 ▲0.0733.99 ▼2.25
Portfolio Categories /wp-admin/edit-tags.php?taxonomy=fg_portfolio_category&post_type=fg-portfolio3.3033.85
All Portfolios /wp-admin/edit.php?post_type=fg-portfolio3.3537.25
Add New /wp-admin/post-new.php?post_type=fg-portfolio3.4348.76

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 36 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Filterable Portfolio Gallery Plugin: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲8813.26 ▼1.121.75 ▼0.2540.89 ▲1.63
Dashboard /wp-admin2,237 ▲464.81 ▼0.11105.97 ▼13.4740.17 ▼6.39
Posts /wp-admin/edit.php2,120 ▲342.06 ▲0.0740.03 ▲3.6835.14 ▲1.86
Add New Post /wp-admin/post-new.php1,544 ▲2523.62 ▲0.51628.61 ▼44.7049.41 ▼4.50
Media Library /wp-admin/upload.php1,419 ▲284.20 ▲0.0196.81 ▲0.0443.47 ▼1.66
Portfolio Categories /wp-admin/edit-tags.php?taxonomy=fg_portfolio_category&post_type=fg-portfolio1,2962.1325.6427.99
All Portfolios /wp-admin/edit.php?post_type=fg-portfolio1,1011.9329.3529.92
Add New /wp-admin/post-new.php?post_type=fg-portfolio2,2837.87158.8561.51

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/fg-gallery/fg-gallery.php
  • 10× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant FILTER_GALLERY_DIR - assumed 'FILTER_GALLERY_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/fg-gallery/functions.php on line 7
    • > PHP Notice
      Undefined variable: heading_title_text in wp-content/plugins/fg-gallery/includes/fg-filter-gallery-content.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/fg-gallery/includes/single-fg-portfolio.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_terms() in wp-content/plugins/fg-gallery/includes/fg-filter-gallery-content.php:35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/fg-gallery/includes/extend/fg-gallery-shortcodes-buttons.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/fg-gallery/includes/fg-gallery-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/fg-gallery/includes/fg_galaxy_post_types.php:60
    • > PHP Fatal error
      require_once(): Failed opening required 'FILTER_GALLERY_DIR/includes/fg_galaxy_post_types.php' (include_path='.:/usr/share/php') in wp-content/plugins/fg-gallery/functions.php on line 7
    • > PHP Warning
      require_once(FILTER_GALLERY_DIR/includes/fg_galaxy_post_types.php): failed to open stream: No such file or directory in wp-content/plugins/fg-gallery/functions.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/fg-gallery/includes/fg-gallery-shortcodes.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% 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
Please fix the following attributes:
  • Requires at least: The plugin version is formatted incorrectly
  • Screenshots: Add descriptions for screenshots #4, #5, #6, #7, #8 in fg-gallery/assets to your readme.txt
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
You can look at the official readme.txt

fg-gallery/fg-gallery.php Passed 13 tests

"Filterable Portfolio Gallery Plugin" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
68 characters long description:
A plugin to show your work portfolio in more than 100 possible ways.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin14,490 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
CSS664812311,370
JavaScript66683032,022
SVG200732
PHP93576366

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.20
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/gt-btn-icon.png4.54KB2.57KB▼ 43.33%