10% wp-fake-image-replacer

Code Review | WP Fake Image Replacer

WordPress plugin WP Fake Image Replacer scored10%from 54 tests.

About plugin

  • Plugin page: wp-fake-image-rep...
  • Plugin version: 1.5.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.5.1
  • WordPress version: 6.3.1
  • First release: May 5, 2013
  • Latest release: Jun 8, 2013
  • Number of updates: 32
  • Update frequency: every 2.5 days
  • Top authors: maximebj (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active /2,435 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/wp-fake-image-replacer/apis/phpFlickr.php+22
    Methods with the same name as their class will not be constructors in a future version of PHP; phpFlickr has a deprecated constructor

Server metrics [RAM: ▼1.12MB] [CPU: ▼59.67ms] Passed 4 tests

This is a short check of server-side resources used by WP Fake Image Replacer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.86 ▼0.606.17 ▼36.98
Dashboard /wp-admin2.88 ▼0.427.72 ▼42.06
Posts /wp-admin/edit.php2.88 ▼0.479.54 ▼41.62
Add New Post /wp-admin/post-new.php2.88 ▼3.009.02 ▼118.01
Media Library /wp-admin/upload.php2.88 ▼0.3510.49 ▼27.52
WP Fake Image /wp-admin/options-general.php?page=wpfir_settings2.888.03

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
wpfir_settings
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for WP Fake Image Replacer
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲3813.24 ▼1.064.04 ▲2.0642.19 ▼3.50
Dashboard /wp-admin2,210 ▲194.88 ▲0.01109.48 ▲9.8342.32 ▼3.20
Posts /wp-admin/edit.php2,093 ▲42.04 ▲0.0538.98 ▲3.4435.24 ▲0.10
Add New Post /wp-admin/post-new.php1,535 ▲722.17 ▲3.65653.51 ▼8.8256.26 ▲4.60
Media Library /wp-admin/upload.php1,395 ▲74.14 ▼0.16105.08 ▼12.6148.21 ▼0.21
WP Fake Image /wp-admin/options-general.php?page=wpfir_settings1,1362.8546.4429.74

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/wp-fake-image-replacer/apis/phpFlickr.php+22
    Methods with the same name as their class will not be constructors in a future version of PHP; phpFlickr has a deprecated constructor
  • The uninstall procedure has failed, leaving 7 options in the database
    • wpfir_settings
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=wpfir_settings
    • > Deprecated in wp-content/plugins/wp-fake-image-replacer/apis/phpFlickr.php+22
    Methods with the same name as their class will not be constructors in a future version of PHP; phpFlickr has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=wpfir_settings
    • > Deprecated in wp-content/plugins/wp-fake-image-replacer/apis/phpFlickr.php+1684
    Methods with the same name as their class will not be constructors in a future version of PHP; phpFlickr_pager has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=wpfir_settings
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=wpfir_settings
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-fake-image-replacer/core/controllers/options-page.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/wp-fake-image-replacer/core/views/options-page.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: post thumbnail, image replacer, theme development, fake image, image holder

wp-fake-image-replacer/wp-fake-image-replacer.php Passed 13 tests

This is the main PHP file of "WP Fake Image Replacer" version 1.5.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
119 characters long description:
Replace an empty post thumbnail with a same size fake image. Useful for theme developement. Just activate and it works.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin2,052 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP44895731,604
JavaScript27015357
PO File1282991

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity58.75
▷ Minimum class complexity7.00
▷ Maximum class complexity184.00
Average method complexity2.01
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods229
▷ Static methods00.00%
▷ Public methods22698.69%
▷ Protected methods00.00%
▷ Private methods31.31%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
There are no PNG files in this plugin