Jesin's Blog

Welcome to the Portal of Technology

  • Facebook
  • GitHub
  • Google+
  • RSS
  • Twitter
  • Home
  • Categories
    • Domains
    • Linux
    • Networking
    • PHP
    • Virtualization
    • Web Design
    • Web Servers
    • Windows
  • WordPress Plugins
    • Custom Error Pages
    • HTTP Digest Authentication
    • Mailgun Email Validator
  • Toolbox
    • DNS Lookup Tool
    • htdigest Generator Tool Online
    • htpasswd Generator Tool Online
    • HTTP Headers Lookup Tool
    • MD5 Encryption Tool
    • Open Port Check Tool
    • SHA-1 Encryption Tool
    • URL Encoding/Decoding Tool
  • About Me
  • Contact Me
  • Sitemap
Home ›
Web Design

WP CLI fix “Warning: Some code is trying to do a URL redirect.” error

July 22, 2018 Web Design Jesin A Leave a Comment

The WordPress command-line interface is incredibly useful when changing the domain URL of a website. When working on a client’s website I encountered the following warning when I ran the wp search-replace command.

Warning: Some code is trying to do a URL redirect. Backtrace:
#0  WP_CLI\Utils\wp_redirect_handler(http://example.com/) called at [/srv/users/serverpilot/apps/APPNAME/public/wp-includes/class-wp-hook.php:288]
#1  WP_Hook->apply_filters(http://example.com/, Array ([0] => http://example.com/,[1] => 301)) called at [/srv/users/serverpilot/apps/APPNAME/public/wp-includes/plugin.php:203]
#2  apply_filters(wp_redirect, http://example.com/, 301) called at [/srv/users/serverpilot/apps/APPNAME/public/wp-includes/pluggable.php:1199]
#3  wp_redirect(http://example.com/, 301) called at [/srv/users/serverpilot/apps/APPNAME/public/wp-content/plugins/quick-pagepost-redirect-plugin/page_post_redirect_plugin.php:2151]
#4  quick_page_post_reds->redirect() called at [/srv/users/serverpilot/apps/APPNAME/public/wp-includes/class-wp-hook.php:286]
#5  WP_Hook->apply_filters(, Array ([0] => )) called at [/srv/users/serverpilot/apps/APPNAME/public/wp-includes/class-wp-hook.php:310]
#6  WP_Hook->do_action(Array ([0] => )) called at [/srv/users/serverpilot/apps/APPNAME/public/wp-includes/plugin.php:453]
#7  do_action(init) called at [/srv/users/serverpilot/apps/APPNAME/public/wp-settings.php:450]
#8  require(/srv/users/serverpilot/apps/APPNAME/public/wp-settings.php) called at [phar:///opt/sp/bin/wp-cli.phar/php/WP_CLI/Runner.php:1174]
#9  WP_CLI\Runner->load_wordpress() called at [phar:///opt/sp/bin/wp-cli.phar/php/WP_CLI/Runner.php:1100]
#10 WP_CLI\Runner->start() called at [phar:///opt/sp/bin/wp-cli.phar/php/WP_CLI/Bootstrap/LaunchRunner.php:23]
#11 WP_CLI\Bootstrap\LaunchRunner->process(WP_CLI\Bootstrap\BootstrapState Object ([WP_CLI\Bootstrap\BootstrapStatestate] => Array ())) called at [phar:///opt/sp/bin/wp-cli.phar/php/bootstrap.php:75]
#12 WP_CLI\bootstrap() called at [phar:///opt/sp/bin/wp-cli.phar/php/wp-cli.php:23]
#13 include(phar:///opt/sp/bin/wp-cli.phar/php/wp-cli.php) called at [phar:///opt/sp/bin/wp-cli.phar/php/boot-phar.php:8]
#14 include(phar:///opt/sp/bin/wp-cli.phar/php/boot-phar.php) called at [/opt/sp/bin/wp-cli.phar:4]

Googling this warning message brought up several links to GitHub which all recommended using the --user=someadmin parameter. I tried that too but got the same warning. Looking at the backtrace log it is clear that the quick-pagepost-redirect-plugin is causing this redirect, so I used the --skip-plugins= parameter to skip loading this plugin.

wp search-replace --skip-plugins=quick-pagepost-redirect-plugin 'http://example.com' 'https://example.com' --skip-columns=guid

And I had no issues running the search and replace operation.

On a sidenote if you are looking for a shared web host with WP CLI support choose SiteGround (affiliate link). They also have other WordPress specific features like automated migration and caching.

Tags: wordpress, wp-cli

Please fix your WP.org Plugin screenshots

January 1, 2015 Web Design Jesin A 2 Comments

This is a mistake committed even by people I consider the Gods of WordPress (as you’ll see in the screenshot below) and plugins with a million downloads. Even the plugin’s created by the plugin reviewers weren’t spared. Rather than a mistake I would say they all overlooked this minor setting that can ruin a plugin hunter’s experience.

The WordPress.org plugin repository has (or rather had) an annoying feature, when you click on a plugin screenshot on the hopes of viewing it larger the browser pops up the download box like this:
Continue Reading…

Tags: svn, wordpress

How to Add/Remove text boxes using jQuery and PHP

January 26, 2014 Web Design Jesin A 42 Comments

jquery add remove textbox

This is my first post this year and the first tutorial using jQuery. In this tutorial we’ll see how to add or remove text input fields in a HTML form using jQuery and process the submitted data using PHP. The biggest advantage of jQuery lies in its simplicity of selecting elements. Plain JavaScript would require numerous getElementBy… methods and sifting through indexes to select the right element whereas jQuery does it with just a simple $('.class1 .class2 element') similar to CSS thanks to Sizzlejs.Continue Reading…

Tags: jquery

Username availability check with AJAX and PHP

March 13, 2013 Web Design Jesin A 6 Comments

web design category thumbnail

Recently the AJAX bug bit me and I started rewriting the code of htdigest generator, htpasswd generator and URL encoder/decoder after learning some basics from w3schools.com. I tried creating a username availability validator using AJAX and it worked well so I am here writing this article on how to do this. I will be concentrating more on the AJAX part and less on PHP because I have already written an article on how to connect PHP and MySQL. In the end of this article there is a link to a demo which I created, it has a HTML form sans form tags 😛 just to demonstrate username validation.Continue Reading…

Tags: ajax, javascript, php

How to create a horizontal drop down menu in CSS

November 2, 2011 Web Design Jesin A Leave a Comment

web design category thumbnail

Its been a long time since I wrote an article in this category (Web Design) so I decided to write an article on creating a horizontal drop down menu purely with HTML and CSS. To create a simple menu see CSS Horizontal Navigation Menu. Since the horizontal drop down menu uses only CSS and HTML it doesn’t work with Internet Explorer 6. The whole drop down menu concept makes use of the CSS pseudo class :hover, when you place the mouse pointer over a parent menu the CSS “display” attribute changes to “block” and displays the drop down menu, when you move the mouse pointer away from the menu the “display” attribute changes to “none” so the drop down menu disappears.Continue Reading…

Tags: css, html

CSS Tableless Design Tutorial

June 25, 2011 Web Design Jesin A 3 Comments

web design category thumbnail

This tutorial teaches you how to create your website neatly sans tables. All along people used tables to create column layouts and templates for their websites because they shied away from learning CSS and <div>s. If you thought creating web pages with divs are difficult you are about to change your mind after reading this tutorial, because HTML tables have many problems which can be overcome using divs. Take an example of changing the size of a column while using <table> tag, expanding a column also expands the column next to it. Of course you can use colspan and rowspan attributes to correct this to an extent but that makes it cumbersome and eats up precious bytes. With tableless design in CSS you can overcome all these problems and have complete control over your design, whats more search engines also start liking your website.Continue Reading…

Tags: css, html

  • 1
  • 2
  • Next Page »

Get a wealth of information delivered to your inbox. Subscribe and never miss a single article.

  • Tutorials and howtos
  • Code, scripts and commands
  • Online Tools

* No spam, unsubscribe anytime

Hire Me

  • SSL installation and hardening (A+ on Qualys SSL test)
  • Apache & Nginx configuration
  • Email deliverability improvement (10/10 on Mail Tester & MailGenius)
  • WordPress customization, optimization and migration
  • and much more…

    Tools

    • DNS Lookup Tool
    • htdigest Generator Tool Online
    • htpasswd Generator Tool Online
    • HTTP Headers Lookup Tool
    • MD5 Encryption Tool
    • Open Port Check Tool
    • SHA-1 Encryption Tool
    • URL Encoding/Decoding Tool

    Nav

    • Home
    • About Me
    • Contact Me
    • Privacy Policy
    • Sitemap
    Vultr SSD VPS

    Creative Commons License
    Jesin's Blog by Jesin A is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
    Based on a work at websistent.com.