94% amp-social-share

Code Review | AMP Social Share

WordPress plugin AMP Social Share scored 94% from 54 tests.

About plugin

  • Plugin page: amp-social-share
  • Plugin version: 2.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.3-4.7
  • WordPress version: 5.9.2
  • First release: Oct 28, 2016
  • Latest release: Dec 20, 2016
  • Number of updates: 26
  • Update frequency: every 2.0 days
  • Top authors: nmvdvjr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 2,763 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼290.22ms] Passed 4 tests

A check of server-side resources used by AMP Social Share
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.0560.55 ▲0.64
Dashboard /wp-admin3.47 ▲0.0637.32 ▲0.58
Posts /wp-admin/edit.php3.69 ▲0.0541.75 ▲2.00
Add New Post /wp-admin/post-new.php6.93 ▼0.04107.59 ▼1,162.16
Media Library /wp-admin/upload.php3.35 ▲0.0528.11 ▲0.07

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for AMP Social Share
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,815 ▲6115.79 ▼0.205.87 ▼0.362.43 ▼0.42
Dashboard /wp-admin2,918 ▲646.23 ▲0.13116.91 ▼35.79167.53 ▼2.87
Posts /wp-admin/edit.php2,706 ▲123.23 ▲0.0062.99 ▼0.63144.99 ▲2.33
Add New Post /wp-admin/post-new.php1,732 ▼2016.97 ▼4.63441.20 ▼3.83190.42 ▲33.00
Media Library /wp-admin/upload.php1,715 ▲175.52 ▲0.02125.69 ▼31.33206.45 ▲19.90

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled completely, with no zombie files or tables

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 no errors were found, this is by no means an exhaustive test

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
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/amp-social-share/AMP-social-share.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention: You can take inspiration from this readme.txt

amp-social-share/AMP-social-share.php 92% from 13 tests

"AMP Social Share" version 2.2.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("amp-social-share.php" instead of "AMP-social-share.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin253 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP19014253

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.20
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 Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/icon.png3.19KB0.49KB▼ 84.52%