84% fotorama

Code Review | Fotorama

WordPress plugin Fotorama scored 84% from 54 tests.

About plugin

  • Plugin page: fotorama
  • Plugin version: 4.6.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.9.1
  • WordPress version: 6.3.1
  • First release: Sep 7, 2013
  • Latest release: Dec 31, 2014
  • Number of updates: 61
  • Update frequency: every 8.2 days
  • Top authors: artpolikarpov (100%)

Code review

54 tests

User reviews

24 reviews

Install metrics

7,000+ active / 45,697 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.32ms] Passed 4 tests

This is a short check of server-side resources used by Fotorama
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.40 ▼11.16
Dashboard /wp-admin3.31 ▲0.0042.51 ▼5.68
Posts /wp-admin/edit.php3.36 ▲0.0046.82 ▲0.55
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.55 ▼0.22
Media Library /wp-admin/upload.php3.23 ▲0.0034.26 ▼0.20

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Fotorama: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,930 ▲19513.72 ▼1.076.40 ▲4.3538.84 ▼5.87
Dashboard /wp-admin2,208 ▲204.87 ▼0.98107.76 ▼11.5140.04 ▼4.75
Posts /wp-admin/edit.php2,091 ▼12.00 ▼0.0339.63 ▲3.7735.29 ▲3.05
Add New Post /wp-admin/post-new.php1,539 ▲1918.34 ▼4.63631.04 ▼24.6255.80 ▼13.62
Media Library /wp-admin/upload.php1,390 ▲54.19 ▼0.0793.66 ▼13.8841.28 ▼2.38

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

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 | 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
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/fotorama/fotorama.php:16
    • > 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/fotorama/fotorama.php on line 16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration Passed 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
9 plugin tags: images, plugin, fotorama, image, shortcode...

fotorama/fotorama.php Passed 13 tests

The main PHP script in "Fotorama" version 4.6.3 is automatically included on every request by WordPress
126 characters long description:
Transforms standard galleries into fotoramas. Fotorama is a simple, stunning, powerful jQuery gallery. Licensed under the MIT.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected3,396 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript27212002,810
CSS2734506
PHP1251680

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
2 compressed PNG files occupy 0.01MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
fotorama@2x.png7.15KB7.53KB0.00%
fotorama.png3.15KB3.22KB0.00%