72% cm-on-demand-search-and-replace

Code Review | CM On Demand Search And Replace

WordPress plugin CM On Demand Search And Replace scored 72% from 54 tests.

About plugin

  • Plugin page: cm-on-demand-sear...
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4.0-6.3
  • WordPress version: 6.3.1
  • First release: Mar 25, 2015
  • Latest release: Jul 23, 2023
  • Number of updates: 222
  • Update frequency: every 13.7 days
  • Top authors: CreativeMindsSolutions (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

5,000+ active / 109,655 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.67MB] [CPU: ▼4.40ms] 75% from 4 tests

A check of server-side resources used by CM On Demand Search And Replace
Please fix the following
  • CPU: Try to keep total CPU usage under 500.00ms (currently 897.23ms on /wp-admin/admin.php?page=cmodsar_settings)
PageMemory (MB)CPU Time (ms)
Home /4.16 ▲0.7037.88 ▼8.05
Dashboard /wp-admin4.01 ▲0.7150.82 ▲3.26
Posts /wp-admin/edit.php4.06 ▲0.7044.91 ▼2.90
Add New Post /wp-admin/post-new.php6.53 ▲0.6485.93 ▼9.89
Media Library /wp-admin/upload.php3.87 ▲0.6442.88 ▲5.48
User Guide /wp-admin/admin.php?page=cmodsar_about4.04384.36
Settings /wp-admin/admin.php?page=cmodsar_settings4.08897.23
Upgrade ➤ /wp-admin/admin.php?page=cmodsar_pro3.9032.37

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 84 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
cmodsar_searchAndReplaceOnPosttypes
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for CM On Demand Search And Replace
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲9513.27 ▼1.131.75 ▼0.1041.17 ▲2.90
Dashboard /wp-admin2,239 ▲485.82 ▲0.9395.16 ▼7.6373.61 ▲25.16
Posts /wp-admin/edit.php2,121 ▲322.02 ▲0.0134.81 ▼7.3138.73 ▲2.03
Add New Post /wp-admin/post-new.php1,694 ▲16021.03 ▼2.00807.97 ▲124.2062.08 ▲9.65
Media Library /wp-admin/upload.php1,415 ▲274.18 ▲0.0495.69 ▼29.0383.71 ▲35.72
User Guide /wp-admin/admin.php?page=cmodsar_about3,89917.32448.08249.15
Settings /wp-admin/admin.php?page=cmodsar_settings2,4318.4792.9477.72
Upgrade ➤ /wp-admin/admin.php?page=cmodsar_pro1,8442.2540.3647.06

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • cmodsar_searchAndReplaceOnPosttypes
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
The following issues need your attention
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/cm-on-demand-search-and-replace/views/backend/admin_nav.php
    • > /wp-content/plugins/cm-on-demand-search-and-replace/views/backend/admin_about.php
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/cm-on-demand-search-and-replace/package/views/userguide_free.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cm-on-demand-search-and-replace/package/cminds-plugin-config.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_shortcode() in wp-content/plugins/cm-on-demand-search-and-replace/views/backend/admin_settings.php:8
    • > PHP Warning
      Use of undefined constant CMODSAR_NAME - assumed 'CMODSAR_NAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/cm-on-demand-search-and-replace/views/backend/admin_about.php on line 6
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/cm-on-demand-search-and-replace/views/backend/admin_nav.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cm-on-demand-search-and-replace/package/cminds-plugin-config.php:3
    • > PHP Notice
      Undefined variable: submenus in wp-content/plugins/cm-on-demand-search-and-replace/views/backend/admin_nav.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cm-on-demand-search-and-replace/cm-on-demand-search-and-replace.php:79
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cm-on-demand-search-and-replace/views/backend/admin_template.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/cm-on-demand-search-and-replace/package/views/plugin_compare_table.php:51

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=cmodsar_about
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
    • > GET request to /wp-admin/admin.php?page=cmodsar_about
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.
    • > GET request to /wp-admin/admin.php?page=cmodsar_about
    • > Deprecation (warning) in unknown
    https://static.xx.fbcdn.net/rsrc.php/v3/yX/r/ZCMynepIOyM.js?_nc_x=Ij3Wp8lg5Kz 271 Listener added for a synchronous 'DOMSubtreeModified' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead.
    • > GET request to /wp-admin/admin.php?page=cmodsar_about
    • > Console-api (severe) in unknown
    https://static.xx.fbcdn.net/rsrc.php/v3/yX/r/ZCMynepIOyM.js?_nc_x=Ij3Wp8lg5Kz 60:573 "ErrorUtils caught an error:\n\nCannot listen to an undefined element. [Caught in: Tried to listen to element of type click]\n\nSubsequent non-fatal errors won't be logged; see https://fburl.com/debugjs."
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cmodsar_settings
    • > Security (severe) in unknown
    /wp-content/plugins/cm-on-demand-search-and-replace/package/js/froogaloop.js 0 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://player.vimeo.com') does not match the recipient window's origin ('').

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% 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:
  • Screenshots: Please add an image for screenshot #1 (Search and Replace using timeframe restriction)
You can take inspiration from this readme.txt

cm-on-demand-search-and-replace/cm-on-demand-search-and-replace.php Passed 13 tests

The primary PHP file in "CM On Demand Search And Replace" version 1.3.1 is used by WordPress to initiate all plugin functionality
67 characters long description:
Searches and replaces the words and phrases throughout the content.

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
Everything looks great! No dangerous files found in this plugin7,002 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP157975115,260
CSS5147501,458
JavaScript46334284

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity111.67
▷ Minimum class complexity37.00
▷ Maximum class complexity254.00
Average method complexity4.03
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods111
▷ Static methods3733.33%
▷ Public methods10190.99%
▷ Protected methods109.01%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants19
▷ Global constants1578.95%
▷ Class constants421.05%
▷ Public constants4100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
54 PNG files occupy 0.57MB with 0.29MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
package/CMWPPluginssuite.png33.88KB12.59KB▼ 62.83%
assets/css/images/ui-icons_2e83ff_256x240.png4.44KB4.17KB▼ 6.02%
assets/css/images/ui-bg_glass_55_fbf9ee_1x400.png0.33KB0.12KB▼ 62.09%
package/views/businessdir.png30.22KB8.77KB▼ 70.98%
package/css/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%