You are currently browsing posts tagged “javascript”

WordPress Brute Force Attacks on non-WordPress Sites

December 1, 2017 // Posted in Computer Tips, General, Main, Tips and Tricks (Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , ) |  No Comments

There are more and more would-be hackers out there that are trying to attack WordPress Sites via a brute force attack on the wp-login.php file that is used on worpress sites to log in to the site.

The problem is that they do not know what are WordPress Sites and what are not so they try connecting to a wp-login.php file on almost every site. This can lead to hundreds of attempts on your non-wordpress by these hackers trying to find a wp-login.php file on your server. Check your server log and you will see all these attempts.

Now if as many people as possible added a wp-login.php to their non-wordpress site re-directing any call to that page back to the IP address that attempted to find it, then these idiots would perform a DOS attack on their own PC,
and stop them sending any more requests.

Here’s how to do it:

Create a file called wp-login.php in your non-wordpress site’s root folder with the following text in it (Your server must be php enabled):

 

 

 

 

Let’s hit back at these idiots together.
Steve

Its All About Position!

January 9, 2014 // Posted in Main, Tips and Tricks (Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ) |  No Comments

triplepivotPosition is important in many things in life, work, football, cricket and even sex.

If you are not in the right position something will go wrong!

It is the same with code on your pages, particularly with jquery and jquery-ui.

How many times have you added an additional jquery widget to one of your pages only to find something else that used to work, no longer does.

I get many requests for help for exactly the same issue and see many posts on forums with the same problems. When you look at the responses that others have given, you will often see complicated modifications to javascript libraries, or lots of additional code or changes to code that are supposed to fix the issues, such as jquery noConflicts and the like. In some cases these do fix the immediate problem, but involve quite a bit of work and some require a reasonable knowledge of javascript coding.

In almost all of the situations I have been asked to help with, however, I have found the solution to be much simpler, it’s about position and what is loaded and when.

Before entering into any complicated code changes here is something to try first, it won’t  require any modifications to code or re-writing javascript libraries and even those with little or no javascript knowledge can make the changes.

Let’s imagine you have a javascript gallery on your page, this will require a jquery library, some code in the head of your page and some in the body, when using WebPlus these will be added automatically by the program and will not be moveable as WebPlus controls their location.  You now add a third party javascript add-on that tells you to add some code to the head of your page and some to the body, they will also tell you to include a jquery library and perhaps a jquery-ui library. Well first of all forget adding the jquery library if WebPlus has already added it’s own, as if there is two on the same page that will in itself cause conflicts.

Secondly if the code you added to the head for your third party contains $ signs to call functions in jquery etc then you will more than likely find that something will not work after you add it, either your javascript gallery or your new add-on.

Before you get into complicated modifications here is a tip when your new add-on causes issues with your currently working javascript add-on :

Firstly forget the old addage of ‘You must add your scripts to the head of your page’, that’s a load of twoddle.

Move the code that you added for your new add-on to the body of your page, firstly just after the body tag (in WebPlus paste it over the !– Page Body Start — tag), so that all your new code is below your original add-on’s code.

If that doesn’t get both working move your new code to just before the body end tag, (In WebPlus paste it over the — Page Body End — tag).

In most cases the above will fix the issue and both your add-ins will work happily together.

Sometimes you may have more than two add-ins on a page and one or another stops working when the additional ones are added. Play around with the position of each script on the page  until you get the right combination, and you will fix most conflicts with positions. Don’t forget to also check for duplicate libraries, and make sure that the libraries are loaded before any scripts that call them come into play, It’s all about position again.

As I said at the start I have found that most problems with javascript conflicts can be fixed with position of the scripts, so you can save yourself a lot of work by playing with positions before anything else.

I hope that this helps someone.

Steve

 

 

 

 

 

CloudFlare and Your Web Site

July 12, 2013 // Posted in Main, Tips and Tricks (Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , ) |  No Comments

CloudFlare

CloudFlare *
and your Web Site

Have you been given the option by your host to install CloudFlare Security on your WebSpace?

 

 

Are you now getting problems with javascripts not working, or some php pages not working correctly?
If the answer to the above questions is Yes, then it appears that the problem with your scripts not working or your php pages not working correctly may be down to CloudFlare.
While trying to solve the same issues for a friend on her site, it was identified that there was nothing wrong with the php code or javascript code as the same pages worked fine on other servers.
Further investigation revealed that something was affecting the headers being processed by the php engine. Some php code requires that the php pages code is the first thing processed by the php engine, and on looking at error logs on the server, the error was ‘cannot send header code on page xxx.php, header already sent’.
The obvious reasons for this were checked, code was correct and in the right place as the first line in the php page, the file had was not saved as utf-8 with BOM, so something else was affecting the page headers.
CloudFlare was switched off and everything started working fine again. It appears that CloudFlare may be adding it’s own headers to pages before they are processed by the php engine and that was what was causing the pages not to perform correctly.

* CloudFlare orange cloud logo is a trademark of CloudFlare, Inc and is acknowledged as such.

 

%d bloggers like this: