10% gdp-social-overlay

Code Review | #GDP-SocialOverlay

WordPress plugin #GDP-SocialOverlay scored 10% from 53 tests.

About plugin

  • Plugin page: gdp-social-overlay
  • Plugin version: 0.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.0
  • WordPress version: 5.8.1
  • First release: Apr 1, 2015
  • Latest release: Apr 4, 2015
  • Number of updates: 14
  • Update frequency: every 0.3 days
  • Top authors: johnnydp (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 821 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • Install procedure had errors
    • > Warning in wp-content/plugins/gdp-social-overlay/so-admin.php+11
    Use of undefined constant gdpGeneralShow - assumed 'gdpGeneralShow' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.87MB] [CPU: ▼328.56ms] Passed 4 tests

Server-side resources used by #GDP-SocialOverlay
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1333.45 ▲15.98
Dashboard /wp-admin1.78 ▼1.275.06 ▼38.92
Posts /wp-admin/edit.php1.78 ▼1.325.15 ▼39.47
Add New Post /wp-admin/post-new.php1.78 ▼3.655.09 ▼1,197.90
Media Library /wp-admin/upload.php1.78 ▼1.235.77 ▼37.96
Social Overlay /wp-admin/admin.php?page=gdp-social-overlay1.784.33
GDP Plugins /wp-admin/admin.php?page=gdp-plugins1.785.03

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 21 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by #GDP-SocialOverlay
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,711 ▲10515.90 ▲0.368.55 ▲0.9848.57 ▲0.26
Dashboard /wp-admin2,956 ▲1065.91 ▼0.05132.05 ▲5.95117.19 ▲18.12
Posts /wp-admin/edit.php2,754 ▲482.68 ▲0.0065.00 ▼5.1089.65 ▲1.49
Add New Post /wp-admin/post-new.php1,675 ▼17818.85 ▼0.22373.68 ▼62.15109.77 ▼3.86
Media Library /wp-admin/upload.php1,743 ▼294.99 ▲0.00130.94 ▼23.77138.17 ▲22.60
Social Overlay /wp-admin/admin.php?page=gdp-social-overlay1,2452.2156.1463.89
GDP Plugins /wp-admin/admin.php?page=gdp-plugins9862.2253.5846.18

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
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/gdp-social-overlay/so-admin.php+11
    Use of undefined constant gdpGeneralShow - assumed 'gdpGeneralShow' (this will throw an Error in a future version of PHP)

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=gdp-plugins
    • > Warning in wp-content/plugins/gdp-social-overlay/so-admin.php+11
    Use of undefined constant gdpGeneralShow - assumed 'gdpGeneralShow' (this will throw an Error in a future version of PHP)
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=gdp-plugins
    • > User deprecated in wp-includes/functions.php+5495
    has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/admin.php?page=gdp-social-overlay
    • > Notice in wp-content/plugins/gdp-social-overlay/so-admin-view.php+8
    Undefined index: refresh-gdpsocial
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=gdp-social-overlay
    • > Notice in wp-content/plugins/gdp-social-overlay/so-admin-view.php+83
    Trying to access array offset on value of type bool

SRP 50% 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
Please take a closer look at the following
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gdp-social-overlay/so-admin.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/gdp-social-overlay/index.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/gdp-social-overlay/so-admin-view.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gdp-social-overlay/so-front.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === gdp-social-overlay === )
The official readme.txt is a good inspiration

gdp-social-overlay/index.php 85% from 13 tests

This is the main PHP file of "#GDP-SocialOverlay" version 0.1.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("gdp-social-overlay.php" instead of "index.php")

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 detected338 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP53016228
CSS15066
JavaScript17044

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.70
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 0% from 1 test

Image compression 0% from 1 test

Using a strong compression for your PNG files is a great way to speed-up your plugin
13 PNG files occupy 0.97MB with 0.89MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png185.66KB81.54KB▼ 56.08%
assets/screenshot-2.png47.30KB0.00KB▼ 100.00%
screenshot-4.png89.16KB0.00KB▼ 100.00%
screenshot-2.png47.30KB0.00KB▼ 100.00%
screenshot-3.png77.90KB0.00KB▼ 100.00%