84% custom-field-snippet

Code Review | Custom Field Snippet

WordPress plugin Custom Field Snippet scored 84% from 54 tests.

About plugin

  • Plugin page: custom-field-snippet
  • Plugin version: 4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-3.9.1
  • WordPress version: 6.3.1
  • First release: Nov 13, 2012
  • Latest release: Jun 1, 2014
  • Number of updates: 40
  • Update frequency: every 14.1 days
  • Top authors: ounziw (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

50+ active / 4,451 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.05MB] [CPU: ▼3.36ms] Passed 4 tests

A check of server-side resources used by Custom Field Snippet
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0537.66 ▼3.74
Dashboard /wp-admin3.35 ▲0.0544.69 ▼4.07
Posts /wp-admin/edit.php3.46 ▲0.1143.03 ▼1.53
Add New Post /wp-admin/post-new.php5.94 ▲0.0594.31 ▲1.11
Media Library /wp-admin/upload.php3.27 ▲0.0432.33 ▼4.08

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Custom Field Snippet: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.25 ▼0.181.65 ▼0.3240.83 ▲1.61
Dashboard /wp-admin2,203 ▲185.83 ▲0.9494.60 ▼9.3037.68 ▼7.86
Posts /wp-admin/edit.php2,089 ▲32.02 ▲0.0333.53 ▼2.1733.51 ▼0.45
Add New Post /wp-admin/post-new.php6,494 ▲4,95723.44 ▲0.05897.95 ▲215.2976.09 ▲20.91
Media Library /wp-admin/upload.php1,391 ▲34.22 ▲0.0094.22 ▼6.8644.03 ▼0.31

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

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
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/custom-field-snippet/tests/customtest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/custom-field-snippet/tests/noesctest.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/custom-field-snippet/custom-field-snippet.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/custom-field-snippet/tests/flexibletest.php:8

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 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Please add an image for screenshot #1 (when you use Advanced Custom Field)
The official readme.txt is a good inspiration

custom-field-snippet/custom-field-snippet.php 92% from 13 tests

The main PHP file in "Custom Field Snippet" ver. 4.2 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 158 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin486 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP62536441
PO File1172445

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity5.43
▷ Minimum class complexity1.00
▷ Maximum class complexity20.00
Average method complexity2.15
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes114.29%
▷ Concrete classes685.71%
▷ Final classes00.00%
Methods28
▷ Static methods00.00%
▷ Public methods2796.43%
▷ Protected methods13.57%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png41.22KB15.34KB▼ 62.78%
screenshot-2.png15.36KB6.48KB▼ 57.79%