93% acf-media-credit

Code Review | ACF Media Credit

WordPress plugin ACF Media Credit scored 93% from 54 tests.

About plugin

  • Plugin page: acf-media-credit
  • Plugin version: 2.3.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9
  • WordPress version: 5.8.1
  • First release: Dec 16, 2014
  • Latest release: Apr 2, 2018
  • Number of updates: 66
  • Update frequency: every 18.2 days
  • Top authors: donaldG2 (96.97%)harambe (4.55%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active / 7,300 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by ACF Media Credit
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0040.16 ▲14.27
Dashboard /wp-admin3.06 ▲0.0033.52 ▼9.65
Posts /wp-admin/edit.php3.11 ▲0.0038.56 ▼1.11
Add New Post /wp-admin/post-new.php5.42 ▼0.0288.40 ▼558.39
Media Library /wp-admin/upload.php3.00 ▲0.0028.43 ▼4.72

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 14 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by ACF Media Credit
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲9716.43 ▲1.0611.49 ▲0.3045.41 ▼2.61
Dashboard /wp-admin2,970 ▲365.91 ▼0.09139.09 ▼24.89116.95 ▲14.32
Posts /wp-admin/edit.php2,739 ▼02.85 ▲0.0071.77 ▲2.3389.55 ▼1.81
Add New Post /wp-admin/post-new.php1,876 ▲419.23 ▲0.06364.66 ▼15.85102.02 ▼7.21
Media Library /wp-admin/upload.php1,807 ▼35.05 ▲0.04157.00 ▲8.57123.05 ▼4.35

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstaller ran successfully

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
Even though everything seems fine, this is not 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
Please fix the following
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/acf-media-credit/media-credit.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/acf-media-credit/media-credit.php:18
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/acf-media-credit/media-credit.php on line 10
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/acf-media-credit/media-credit.php on line 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)
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (What the fields look like when added to a media item), #2 (A clearer shot of those fields on a media attachment), #3 (One of the functions available to developers)
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
The official readme.txt might help

acf-media-credit/media-credit.php 85% from 13 tests

Analyzing the main PHP file in "ACF Media Credit" version 2.3.7
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 145 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("acf-media-credit.php" instead of "media-credit.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin566 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP557109436
JSON10088
CSS41042

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.51
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%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.75MB with 0.45MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png656.87KB273.27KB▼ 58.40%
screenshot-3.png70.32KB23.56KB▼ 66.49%
screenshot-2.png39.91KB18.60KB▼ 53.39%