82% flatfolio-flat-cool-wp-portfolio

Code Review | FlatFolio - Portfolio & Gallery

WordPress plugin FlatFolio - Portfolio & Gallery scored 82% from 54 tests.

About plugin

  • Plugin page: flatfolio-flat-co...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.0-4.1
  • WordPress version: 5.8.1
  • First release: Dec 12, 2014
  • Latest release: Dec 12, 2014
  • Number of updates: 21
  • Update frequency: every 0.1 days
  • Top authors: unCommons (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active / 7,544 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼159.36ms] Passed 4 tests

A check of server-side resources used by FlatFolio - Portfolio & Gallery
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.06 ▲0.2328.81 ▲4.06
Dashboard /wp-admin3.19 ▲0.1225.48 ▼15.17
Posts /wp-admin/edit.php3.24 ▲0.1324.96 ▼7.49
Add New Post /wp-admin/post-new.php5.19 ▼0.2460.91 ▼607.30
Media Library /wp-admin/upload.php3.19 ▲0.1921.19 ▼7.46
Categories /wp-admin/edit-tags.php?taxonomy=flatfolio-categories&post_type=flatfolio3.1921.40
Settings /wp-admin/edit.php?post_type=flatfolio&page=flatfolio_options3.1723.18
All Projects /wp-admin/edit.php?post_type=flatfolio3.2223.80
Add New /wp-admin/post-new.php?post_type=flatfolio3.2534.90

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 32 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

FlatFolio - Portfolio & Gallery: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,909 ▲25816.00 ▲0.3711.25 ▲5.7076.70 ▼1.09
Dashboard /wp-admin3,003 ▲1086.18 ▲0.06120.80 ▼16.81204.38 ▲25.48
Posts /wp-admin/edit.php2,807 ▲673.14 ▼0.0865.43 ▲0.19137.90 ▼2.76
Add New Post /wp-admin/post-new.php2,545 ▼1,19816.82 ▼2.24383.47 ▼61.44187.92 ▲20.22
Media Library /wp-admin/upload.php1,815 ▲605.55 ▲0.04127.59 ▼4.05215.34 ▲28.62
Categories /wp-admin/edit-tags.php?taxonomy=flatfolio-categories&post_type=flatfolio1,8212.7259.63137.37
Settings /wp-admin/edit.php?post_type=flatfolio&page=flatfolio_options1,0942.4156.09114.26
All Projects /wp-admin/edit.php?post_type=flatfolio1,5253.1862.10114.00
Add New /wp-admin/post-new.php?post_type=flatfolio11,0389.46214.32291.02

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=flatfolio
    • > User deprecated in wp-includes/functions.php+5586
    contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.

SRP 0% 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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/flatfolio-flat-cool-wp-portfolio/inc/tpl/flatfolio-main.php
  • 13× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'FF_DIRinc/mega-functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/flatfolio-flat-cool-wp-portfolio/inc/functions.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/flatfolio-flat-cool-wp-portfolio/inc/menus.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/flatfolio-flat-cool-wp-portfolio/inc/assets.php:17
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/flatfolio-flat-cool-wp-portfolio/flatfolio.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/flatfolio-flat-cool-wp-portfolio/inc/install.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/flatfolio-flat-cool-wp-portfolio/inc/templates.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/flatfolio-flat-cool-wp-portfolio/inc/posttypes/flatfolio.php:11
    • > PHP Warning
      Use of undefined constant FF_DIR - assumed 'FF_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/flatfolio-flat-cool-wp-portfolio/inc/functions.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/flatfolio-flat-cool-wp-portfolio/inc/shortcodes.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/flatfolio-flat-cool-wp-portfolio/inc/metaboxes.php:12

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% 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 need to be fixed:
  • Tags: There are too many tags (19 tag instead of maximum 10)
You can look at the official readme.txt

flatfolio-flat-cool-wp-portfolio/flatfolio.php 92% from 13 tests

"FlatFolio - Portfolio & Gallery" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("flatfolio-flat-cool-wp-portfolio.php" instead of "flatfolio.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected4,168 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
CSS383212,101
PHP135302581,013
JavaScript4179112538
SVG100294
PO File19090222

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
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%
Functions41
▷ Named functions41100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/flatfolio_icon.png1.30KB0.40KB▼ 69.35%
assets/img/no_image_large.png4.73KB1.94KB▼ 59.02%
assets/img/no_image_thumb.png4.20KB1.79KB▼ 57.33%
assets/img/no_image_full.png5.68KB2.23KB▼ 60.68%
assets/img/main_icon.png1.58KB0.91KB▼ 42.15%