66% filerenamereplace

Code Review | FileRenameReplace

WordPress plugin FileRenameReplace scored66%from 54 tests.

About plugin

  • Plugin page: filerenamereplace
  • Plugin version: 1.0
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.5
  • WordPress version: 6.3.1
  • First release: May 12, 2018
  • Latest release: May 12, 2018
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: albinvlc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /678 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by FileRenameReplace
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.19 ▼1.36
Dashboard /wp-admin3.34 ▼0.0147.00 ▼11.52
Posts /wp-admin/edit.php3.39 ▲0.0348.22 ▲1.22
Add New Post /wp-admin/post-new.php5.92 ▲0.0380.85 ▼22.49
Media Library /wp-admin/upload.php3.26 ▲0.0336.99 ▲3.03
Replace/Rename /wp-admin/tools.php?page=filerenamereplace3.2529.51

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for FileRenameReplace
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.74 ▲0.371.89 ▲0.2444.19 ▲3.78
Dashboard /wp-admin2,213 ▲255.81 ▼0.0396.82 ▼5.2737.75 ▼4.15
Posts /wp-admin/edit.php2,093 ▲42.04 ▲0.0137.66 ▼2.6831.93 ▼5.29
Add New Post /wp-admin/post-new.php1,517 ▼517.59 ▼5.66685.73 ▲101.4265.34 ▲16.56
Media Library /wp-admin/upload.php1,388 ▼04.21 ▲0.0496.65 ▼1.1040.17 ▼5.16
Replace/Rename /wp-admin/tools.php?page=filerenamereplace9572.0624.7929.89

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/tools.php?page=filerenamereplace
    • > Notice in wp-content/plugins/filerenamereplace/wpa-imageman.php+122
    Undefined variable: iids_cs
    • > GET request to /wp-admin/tools.php?page=filerenamereplace
    • > Notice in wp-content/plugins/filerenamereplace/wpa-imageman.php+150
    Undefined variable: iid
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=filerenamereplace
    • > Notice in wp-content/plugins/filerenamereplace/wpa-imageman.php+176
    Undefined variable: postdate
    • > GET request to /wp-admin/tools.php?page=filerenamereplace
    • > Notice in wp-content/plugins/filerenamereplace/wpa-imageman.php+157
    Undefined variable: filepath
    • > GET request to /wp-admin/tools.php?page=filerenamereplace
    • > Notice in wp-content/plugins/filerenamereplace/wpa-imageman.php+160
    Undefined variable: filename
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=filerenamereplace
    • > Notice in wp-content/plugins/filerenamereplace/wpa-imageman.php+180
    Undefined variable: updir
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=filerenamereplace
    • > Notice in wp-content/plugins/filerenamereplace/wpa-imageman.php+180
    Trying to access array offset on value of type null
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=filerenamereplace
    • > Warning in wp-content/plugins/filerenamereplace/wpa-imageman.php+180
    Use of undefined constant SEP - assumed 'SEP' (this will throw an Error in a future version of PHP)
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=filerenamereplace
    • > Notice in wp-content/plugins/filerenamereplace/wpa-imageman.php+180
    Undefined variable: metadata
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=filerenamereplace
    • > Warning in wp-content/plugins/filerenamereplace/wpa-imageman.php+180
    filesize(): stat failed for SEP
    • > GET request to /wp-admin/tools.php?page=filerenamereplace
    • > Notice in wp-content/plugins/filerenamereplace/wpa-imageman.php+179
    Undefined variable: fileurl

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/filerenamereplace/wpa-imageman.php
  • 38× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/filerenamereplace/wpa-imageman.php on line 180
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/filerenamereplace/wpa-imageman.php on line 170
    • > PHP Notice
      Undefined variable: metadata in wp-content/plugins/filerenamereplace/wpa-imageman.php on line 175
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/filerenamereplace/wpa-imageman.php on line 170
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/filerenamereplace/wpa-imageman.php on line 173
    • > PHP Notice
      Undefined variable: metadata in wp-content/plugins/filerenamereplace/wpa-imageman.php on line 172
    • > PHP Notice
      Undefined variable: iids_cs in wp-content/plugins/filerenamereplace/wpa-imageman.php on line 122
    • > PHP Warning
      Use of undefined constant SEP - assumed 'SEP' (this will throw an Error in a future version of PHP) in wp-content/plugins/filerenamereplace/wpa-imageman.php on line 175
    • > PHP Notice
      Undefined variable: updir in wp-content/plugins/filerenamereplace/wpa-imageman.php on line 173
    • > PHP Notice
      Undefined variable: metadata in wp-content/plugins/filerenamereplace/wpa-imageman.php on line 180

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
    • > GET request to /wp-admin/tools.php?page=filerenamereplace
    • > Network (severe)
    wp-admin/SEP - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Donate link: Invalid url: ""
  • Screenshots: Screenshot #1 (The screen where you can choose the new name or upload the new image.) image not found
Please take inspiration from this readme.txt

filerenamereplace/FileMetadataModifier.php 92% from 13 tests

The main PHP file in "FileRenameReplace" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("filerenamereplace.php" instead of "FileMetadataModifier.php")

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
Good job! No executable or dangerous file extensions detected303 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP24215298
Markdown1305

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity27.00
▷ Minimum class complexity27.00
▷ Maximum class complexity27.00
Average method complexity3.17
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods541.67%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png56.50KB25.66KB▼ 54.60%