Magenta Connect – Access is locked. Please try again in a few minutes.

If you have come to update Magento and got the message “Magenta Connect – Access is locked. Please try again in a few minutes.” and you are prevented from logging in to process updates the chances are the Magento itself is blocking this.

Check using FTP if you have the following file?

/var/brute-force.ini

Then look at the file contents and the chances are you have brute force number as an example:-

brute-force-bad-attempts-count = 1632
brute-force-diff-time-to-attempt = 97920
brute-force-attempts-count = 3
brute-force-last-bad-time = 1537569507

You need to change the files first two lines to:-

brute-force-bad-attempts-count = 0
brute-force-diff-time-to-attempt = 180

You can remove the other lines or changes the values to zero.

You can then update an old version of Magento and its core elements.

Magento Connection Manager

iPad & Iphone CSS Media Queries

Developing websites today means much more thought is required than it used to before the iPad and tablets came about.

A web developer today has to build a website for much larger desktop screen and at the same time make the website work on iPads and tablets.

To help hobby web developers here is some Chameleon help:-

iPad & Iphone CSS Media Queries Landscape and Portrait


/* iPad in portrait & landscape */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px) {
/* Add style here */
}

/* iPad in landscape */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : landscape) {
/* Add style here */
}

/* iPad in portrait */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : portrait) {
/* Add style here */
}

/* iPad mini in portrait & landscape */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (-webkit-min-device-pixel-ratio: 1) {
/* Add style here */
}

/* iPhone 6 in landscape */
@media only screen
and (min-device-width : 375px)
and (max-device-width : 667px)
and (orientation : landscape) {
/* Add style here */
}

/* iPhone 6 in portrait */
@media only screen
and (min-device-width : 375px)
and (max-device-width : 667px)
and (orientation : portrait) {
/* Add style here */
}

/* iPhone 5 & 5S in landscape */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 568px)
and (orientation : landscape) {
/* Add style here */
}

*/ iPhone 5 & 5S in portrait */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 568px)
and (orientation : portrait) {
/* Add style here */
}

Stop YouTube Videos Showing Related Videos At The End

YouTube has made some changes recently and one of them is to automatically play related video’s at the end of a video.

There has always been the show related videos at the end of the video and many webmasters seemed to ignore this which could result in a competitor’s video being shown on your own website. With the new changes competitor’s videos could be played automatically on your website advertising them, this needs to be avoided.

Standard YouTube Embed Code Creates this:-

Click near to the end of the video and see what happens when it finishes.

Stop YouTube Videos Showing Related Videos At The End:-

To do this you simply add the code to tell YouTube that you do not want to display any related videos.

?rel=0

So to show as an example:-

OLD YouTube Embed Code

<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/fKdCQzF4JZ0″ frameborder=”0″ allowfullscreen></iframe>

NEW YouTube Embed Code

<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/fKdCQzF4JZ0?rel=0” frameborder=”0″ allowfullscreen></iframe>

<hr>

Other Embedding Options You Can Use

To make a YouTube video play automatically simply add “&autoplay=1” to the video’s embed code:

<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/fKdCQzF4JZ0?rel=0&autoplay=1 frameborder=”0″ allowfullscreen></iframe>

Opencart Redirect “index.php?route=common/home” to main page

We thought we would share with you a nice way to clean up your home page URL when using Opencart.

For example the standard Opencart home page is defined as:-

http://www.chameleonwebservices.co.uk/index.php?route=common/home

For SEO reasons and to look nice and clean, it is good to set up a 301 redirect to the main domain name which would make the home:-

http://www.chameleonwebservices.co.uk/

To do this you can use .htacess and simply add the following:-

RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteCond %{REQUEST_METHOD} !^POST$
RewriteRule ^index\.php$ http://%{HTTP_HOST}? [R=301,L]

Opencart system/library/encryption.php on line 8

We discovered this today and thought we would share it to help others find a solution quicker.

We have moved a client using OpenCart from a shared hosting server to a new VPS server.

Moving OpenCart Installation To New Server

  1. Backup current site files to local machine using FTP.
  2. Upload site files to new hosting server using FTP.
  3. Copy Database of current site.
  4. Create a new database on the new server.
  5. Import the database from the backup.
  6. Change the config files to ensure you have the correct information.
    1. DB_HOSTNAME
    2. DB_USERNAME
    3. DB_PASSWORD
    4. DB_DATABASE
  7. Change the config files directory structure information.
    1. DIR_APPLICATION
    2. DIR_SYSTEM
    3. DIR_DATABASE
    4. DIR_LANGUAGE
    5. DIR_TEMPLATE
    6. DIR_CONFIG
    7. DIR_IMAGE
    8. DIR_CACHE
    9. DIR_DOWNLOAD
    10. DIR_LOGS
  8. Edit you local DNS to check the site is working forcing your PC to view the website domain name at the new server.
    1. Edit Hostfile “C:\windows\system 32\drivers\etc\hosts
    2. add server IP ADDRESS ***.***.***.*** and then the domain name with and without www.

Example:-

127.0.0.1 chameleonwebservices.co.uk

127.0.0.1 www.chameleonwebservices.co.uk

Now test the site and hopefully all works.

Error: Opencart system/library/encryption.php on line 8

We got the following error “Fatal error: Call to undefined function mcrypt_create_iv() in /var/www/vhosts/#######/httpdocs/system/library/encryption.php on line 8”

We took a look at the line of code:-

$this->iv = mcrypt_create_iv(32, MCRYPT_RAND);

We then realised the new server had not go mcrypt so we needed to install this.

To do this you will need to login to the server via a program like PUTTY and run the following:-

yum update
yum install php-mcrypt*

We got:-
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirror.bytemark.co.uk
* extras: mirror.sov.uk.goscomb.net
* updates: mirrors.coreix.net
No package php-mcrypt available.

This did not work due to the package not being available so we had to use:-

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/php-mcrypt-5.3.3-3.el6.x86_64.rpm
yum local install php-mcrypt-5.3.3-3.el6.x86_64.rpm

Now we get:-

Loaded plugins: fastestmirror, security
Setting up Local Package Process
Examining php-mcrypt-5.3.3-3.el6.x86_64.rpm: php-mcrypt-5.3.3-3.el6.x86_64
Marking php-mcrypt-5.3.3-3.el6.x86_64.rpm to be installed
Loading mirror speeds from cached hostfile
* base: mirror.bytemark.co.uk
* extras: mirror.sov.uk.goscomb.net
* updates: mirrors.coreix.net
Resolving Dependencies
–> Running transaction check
—> Package php-mcrypt.x86_64 0:5.3.3-3.el6 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
php-mcrypt x86_64 5.3.3-3.el6 /php-mcrypt-5.3.3-3.el6.x86_64 46 k

Transaction Summary
================================================================================
Install 1 Package(s)

Total size: 46 k
Installed size: 46 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php-mcrypt-5.3.3-3.el6.x86_64 1/1
Verifying : php-mcrypt-5.3.3-3.el6.x86_64 1/1

Installed:
php-mcrypt.x86_64 0:5.3.3-3.el6

Complete!

You will then need to restart your server:

service httpd restart

Now check the website and it should be up and running.