10% gif-animation-preview

Code Review | GIF Animation Preview

WordPress plugin GIF Animation Preview scored 10% from 54 tests.

About plugin

  • Plugin page: gif-animation-pre...
  • Plugin version: 1.10.3
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 21, 2013
  • Latest release: Mar 21, 2016
  • Number of updates: 62
  • Update frequency: every 15.2 days
  • Top authors: SubZtep (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

700+ active / 20,097 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/gif-animation-preview/plugin.php+41
    Use of undefined constant GAP_HOVER_METADATA_NAME - assumed 'GAP_HOVER_METADATA_NAME' (this will throw an Error in a future version of PHP)

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

Analyzing server-side resources used by GIF Animation Preview
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0945.48 ▼2.13
Dashboard /wp-admin3.36 ▲0.0651.52 ▼8.70
Posts /wp-admin/edit.php3.41 ▲0.0651.56 ▼0.90
Add New Post /wp-admin/post-new.php5.94 ▲0.0692.03 ▼34.63
Media Library /wp-admin/upload.php3.28 ▲0.0635.40 ▼3.16
GIF Animation Preview /wp-admin/options-general.php?page=gap-setting3.2535.01

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 12 new options
New WordPress options
gap-effect
gap-mobile
gap-thumbnail
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
gap-hover
GAP_HOVER_METADATA_NAME
can_compress_scripts
gap-type
...

Browser metrics Passed 4 tests

Checking browser requirements for GIF Animation Preview
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲2414.48 ▲1.262.25 ▲0.3441.41 ▼4.60
Dashboard /wp-admin2,210 ▲75.85 ▼0.05105.73 ▼10.2339.07 ▼4.51
Posts /wp-admin/edit.php2,093 ▲41.98 ▼0.0440.07 ▼5.9734.57 ▼6.86
Add New Post /wp-admin/post-new.php1,517 ▼1617.62 ▼5.41631.44 ▼33.6844.42 ▼15.75
Media Library /wp-admin/upload.php1,392 ▲104.19 ▼0.0496.23 ▼1.6242.25 ▼0.82
GIF Animation Preview /wp-admin/options-general.php?page=gap-setting9402.0522.5142.49

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • GAP_HOVER_METADATA_NAME
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% 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)
Even though everything seems fine, this is not an exhaustive test

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: Call to undefined function register_activation_hook() in wp-content/plugins/gif-animation-preview/plugin.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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
These attributes need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === gif-animation-preview === )
Please take inspiration from this readme.txt

gif-animation-preview/plugin.php 92% from 13 tests

The primary PHP file in "GIF Animation Preview" version 1.10.3 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("gif-animation-preview.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin409 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP35532406
JavaScript2152
CSS1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity23.50
▷ Minimum class complexity10.00
▷ Maximum class complexity37.00
Average method complexity2.55
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods29
▷ Static methods26.90%
▷ Public methods2896.55%
▷ Protected methods13.45%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.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
PNG images were not found in this plugin