10% wp-default-feature-image

Code Review | WP Default Feature Image

WordPress plugin WP Default Feature Image scored 10% from 54 tests.

About plugin

  • Plugin page: wp-default-featur...
  • Plugin version: 1.0.1.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Jan 25, 2018
  • Latest release: Jan 26, 2018
  • Number of updates: 4
  • Update frequency: every 1.0 days
  • Top authors: slimvns (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,310 total downloads

Benchmarks

Plugin footprint 75% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/wp-default-feature-image/wpdfi.php+89
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.82MB] [CPU: ▼139.39ms] Passed 4 tests

A check of server-side resources used by WP Default Feature Image
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.8143.87 ▲7.94
Dashboard /wp-admin3.95 ▲0.8964.31 ▲14.50
Posts /wp-admin/edit.php4.01 ▲0.8861.13 ▲4.90
Add New Post /wp-admin/post-new.php6.23 ▲0.79102.06 ▼574.30
Media Library /wp-admin/upload.php3.81 ▲0.8142.80 ▲3.92

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 1,516 new files
Database: no new tables, 1 new option
New WordPress options
wpdfi-settings

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Default Feature Image
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,901 ▲28817.34 ▲1.6510.84 ▼0.1951.62 ▼6.31
Dashboard /wp-admin3,165 ▲2377.96 ▲2.01165.90 ▲3.97124.13 ▲1.24
Posts /wp-admin/edit.php2,966 ▲2274.13 ▲1.4288.06 ▲22.58100.87 ▼0.48
Add New Post /wp-admin/post-new.php1,594 ▲1318.79 ▼1.86361.52 ▼40.11121.52 ▲2.78
Media Library /wp-admin/upload.php1,812 ▲54.77 ▼0.26127.89 ▼44.76128.77 ▼0.49
WPDFI /wp-admin/wpdfi-settings.php260.900.0513.26

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 25% 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 13× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/wp-default-feature-image/templates/admin/blocks/tabs/dfis/exist.blade.php
    • > /wp-content/plugins/wp-default-feature-image/templates/admin/partials/footer.blade.php
    • > /wp-content/plugins/wp-default-feature-image/vendor/vietartisans/templater/tests/templates/test-twig-template.php
    • > /wp-content/plugins/wp-default-feature-image/templates/admin/partials/header.blade.php
    • > /wp-content/plugins/wp-default-feature-image/templates/admin/blocks/taxonomy/exist.blade.php
    • > /wp-content/plugins/wp-default-feature-image/templates/admin/notice.blade.php
    • > /wp-content/plugins/wp-default-feature-image/templates/admin/layout.blade.php
    • > /wp-content/plugins/wp-default-feature-image/templates/admin/blocks/tabs/options/default.blade.php
    • > /wp-content/plugins/wp-default-feature-image/templates/admin/blocks/tabs/dfis/default.blade.php
    • > /wp-content/plugins/wp-default-feature-image/templates/admin/blocks/taxonomy/default.blade.php
  • 483× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\Writer\\TranslationWriterInterface' not found in wp-content/plugins/wp-default-feature-image/vendor/symfony/translation/Writer/TranslationWriter.php:24
    • > PHP Fatal error
      Trait 'Symfony\\Component\\Debug\\Tests\\Fixtures\\InternalTrait2' not found in wp-content/plugins/wp-default-feature-image/vendor/symfony/debug/Tests/Fixtures/InternalClass.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Filter' not found in wp-content/plugins/wp-default-feature-image/vendor/twig/twig/lib/Twig/Filter/Method.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wp-default-feature-image/vendor/symfony/debug/Tests/DebugClassLoaderTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-default-feature-image/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wp-default-feature-image/vendor/symfony/translation/Tests/TranslatorTest.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression' not found in wp-content/plugins/wp-default-feature-image/vendor/twig/twig/lib/Twig/Node/Expression/Unary.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wp-default-feature-image/vendor/symfony/translation/Tests/Dumper/JsonFileDumperTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Illuminate\\Support\\Facades\\Facade' not found in wp-content/plugins/wp-default-feature-image/vendor/illuminate/support/Facades/Validator.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wp-default-feature-image/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php:18

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
    • > GET request to /wp-admin/wpdfi-settings.php
    • > Network (severe)
    wp-admin/wpdfi-settings.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tested up to: Invalid plugin version format
The official readme.txt is a good inspiration

wp-default-feature-image/wpdfi.php 85% from 13 tests

The main PHP script in "WP Default Feature Image" version 1.0.1.1 is automatically included on every request by WordPress
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-default-feature-image.php" instead of "wpdfi.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin76,417 lines of code in 1,168 files:
LanguageFilesBlank linesComment linesLines of code
PHP95810,85224,83744,895
JavaScript14,7963,66816,236
XSD499764,991
reStructuredText892,4142,1313,371
CSS18142,484
JSON22001,622
C22241921,082
Markdown172090577
XML18130387
SVG100288
Blade18524249
C/C++ Header2192155
YAML69155
m42131246
PO File67037
HTML110017
Twig86014
Qt Linguist10010
INI1001

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
The following items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 155)
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity5.08
▷ Minimum class complexity1.00
▷ Maximum class complexity157.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity155.00
Code structure
Namespaces118
Interfaces151
Traits28
Classes753
▷ Abstract classes324.25%
▷ Concrete classes72195.75%
▷ Final classes141.94%
Methods3,941
▷ Static methods2957.49%
▷ Public methods3,35685.16%
▷ Protected methods47011.93%
▷ Private methods1152.92%
Functions332
▷ Named functions16950.90%
▷ Anonymous functions16349.10%
Constants128
▷ Global constants118.59%
▷ Class constants11791.41%
▷ Public constants117100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin