84% giphypress

Code Review | Giphypress

WordPress plugin Giphypress scored84%from 54 tests.

About plugin

  • Plugin page: giphypress
  • Plugin version: 1.6.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7.2
  • WordPress version: 6.3.1
  • First release: Mar 10, 2014
  • Latest release: Mar 13, 2017
  • Number of updates: 30
  • Update frequency: every 37.7 days
  • Top authors: dfinkler (60%)nicksantan (43.33%)

Code review

54 tests

User reviews

5 reviews

Install metrics

3,000+ active /52,099 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.92ms] Passed 4 tests

An overview of server-side resources used by Giphypress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0445.59 ▲5.70
Dashboard /wp-admin3.34 ▼0.0144.06 ▼19.39
Posts /wp-admin/edit.php3.46 ▲0.1045.07 ▼2.00
Add New Post /wp-admin/post-new.php5.93 ▲0.0492.57 ▼2.12
Media Library /wp-admin/upload.php3.27 ▲0.0333.81 ▼0.16

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 59 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Giphypress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,870 ▲12413.43 ▼1.198.51 ▲6.8542.31 ▼1.99
Dashboard /wp-admin2,200 ▲235.56 ▼0.0585.52 ▼15.7038.38 ▼8.21
Posts /wp-admin/edit.php2,102 ▲22.02 ▼0.0139.32 ▲2.3638.05 ▲4.21
Add New Post /wp-admin/post-new.php1,528 ▼022.80 ▼0.28676.03 ▼5.8956.58 ▲4.69
Media Library /wp-admin/upload.php1,402 ▲54.17 ▲0.0094.69 ▼3.6540.70 ▼5.54

Uninstaller [IO: ▲0.00MB] [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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/giphypress/iframe.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/giphypress/iframe.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: A description for screenshot #6 is missing in giphypress/assets to your readme.txt
  • Donate link: Invalid url: "www.giphy.com"
Please take inspiration from this readme.txt

giphypress/giphypress.php Passed 13 tests

The primary PHP file in "Giphypress" version 1.6.2 is used by WordPress to initiate all plugin functionality
95 characters long description:
The official GIPHY plugin allows you to embed awesome GIFs into your Wordpress posts with ease.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected2,795 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
CSS3165401,175
JavaScript92543781,114
HTML13324316
PHP45153190

PHP code Passed 2 tests

A short 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.41
Average class complexity3.50
▷ Minimum class complexity3.00
▷ Maximum class complexity4.00
Average method complexity1.62
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods225.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
24 PNG files occupy 0.10MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
html/img/icon_reactions.png3.48KB0.55KB▼ 84.13%
html/img/icon_search.png3.56KB1.20KB▼ 66.39%
html/img/icon_email.png4.09KB1.20KB▼ 70.67%
img/giphyicon20px.png1.61KB0.69KB▼ 57.26%
img/giphyiconoff20px.png1.15KB0.31KB▼ 73.24%