• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

My Monkey Do

A Log of Coding Solutions

  • Home
  • Web Hosts
  • Tools
  • About

Tools

Thisisunsafe

May 23, 2022 by Webhead

Problem

Sometimes you need to run https sites locally and you can’t get by Chrome’s warning of NET::ERR_CERT_INVALID. Google has removed the link to just bypass this warning recently.

Solution

While this is more of a workaround than a solution (you should resolve the invalid cert), you can get by Chrome’s security warning by typing “thisisunsafe”. Don’t type it in the address bar, just have the window in focus. You won’t see what you’re typing, but when you finish typing the browser window will reload and display the site.

Filed Under: Tools Tagged With: chrome

PHPUnit and PHP 7 problems

April 23, 2018 by Webhead

Problem

I’m using PHPUnit 5.5, upgraded my PHP version to 7.2.  Two problems actually occur.  First there’s this weird error:

Fatal error: Declaration of SebastianBergmann\Comparator\DOMNodeComparator::assertEquals…

Then figuring PHPUnit needs to be upgraded, I ran

phpunit –self-upgrade

And that failed with the same error.  Changing my PHP version back down to 5.6 and running then causes this error:

internal corruption of phar “…phpunit-temp.phar” (truncated entry)

 

Solution

Unfortunately PHPUnit 5.5 only supports up to version 7.1 and any old version of PHPUnit that has an “old” certificate needs to be downloaded/updated manually.

https://github.com/sebastianbergmann/phpunit/issues/1688

 

Filed Under: Coding, Tools

Easy WordPress Localization

November 13, 2013 by Webhead

If you want to localize a plugin or theme or even just change some wording around, or if you are starting from scratch the easiest thing to do is install the Codestyle Localization plugin.

If starting from scratch, just  make sure your plugin or theme loads the file using

[prettify class=”php”] <?php load_plugin_textdomain( $domain, $abs_rel_path, $plugin_rel_path ) ?> [/prettify]

Once that line of code is in the plugin or theme go to Tools->Localization and you should see your plugin or theme listed.

Find your plugin or theme and click on the Add New Language buttton.

Click Rescan.  Have it scan the files.

Click Edit

Click on generate mo-file.

Then you’re all done.

Filed Under: Coding, Off the Shelf, Tools Tagged With: localization, php, wordpress

Environment Setup

October 25, 2013 by Webhead

October 10, 2022

After 9 years, I thought I’d update this list of tools. Only a few passed the test of time:

  • Forklift – (paid) I forgot why I stopped using FileZilla. I think it was just becoming an eyesore.
  • Local WP – Easy setup, easy install, easy to manage WordPress sites.
  • SourceTree – to push/pull your code so it stays in synch with other environments you may have or other teammates.
  • Visual Studio Code – THE editor being used today. Extensions, open source, supported by a big company (Microsoft).  
  • Slack – Still the top chat program.  Crazy, I don’t remember the name “HipChat”. I just remember there was a chat program between AIM and Slack that I used.
  • ImageOptim – To optimize images, taking up less disk space and load faster.
  • Webpack – This is a bundler that has a very steep learning curve. But once set up, it’s not bad.

Virtual Box is still used occasionally, but tools like BrowserStack is enough and IE not being used (finally) helps too.

Dropbox is still worthy to use, but Google Drive is much easier to use. Although it’s not in the list because I don’t use it much.

October 25, 2013

This week I had to temporarily work on a new laptop so I had to set up my dev environment from scratch.  Of course, I wanted the same tools and apps I had on my permanent environment.  I find that these tools and apps stick with you for some time so below is a list of apps that I needed to install on my new development environment.

  • Dropbox – to easily share files between computers both locally and over the web.
  • FileZilla – to upload files to the servers
  • MAMP – to test your code locally before uploading to the live servers
    • See MAMP Optimizations to start MAMP on startup without the GUI.
    • Remember to set the <Directory> override to AllowOverride All if you want your WordPress or other sites to use .htaccess.
  • SourceTree – to push/pull your code so it stays in synch with other environments you may have or other teammates.
    • Set up your SSH keys using BitBucket’s tutorial.
  • Sublime Text 2  – to edit your files.
    • If you want to open files via the terminal, follow this updated tutorial.
  • WordPress – not so much a tool, but it is part of the testing environment.
  • Slack or HipChat -or whatever trending chat program.  to communicate to others
  • Virtual Box – To run those pesky versions of Internet Explorer.
    • Then head on to get free VMs from Microsoft so you can get all the lovely versions of IE.
  • ImageOptim – To optimize images, taking up less disk space and load faster.

Filed Under: Coding, Off the Shelf, Random Thoughts, Tools

GIT PUSH IS FAILED DUE TO RPC FAILURE (RESULT=56)

August 16, 2013 by Webhead

Problem

Pushing to git showed this error:

error: RPC failed; result=56, HTTP code = 0

Solution

The problem is the git buffer is too low.  After finding the solution I realized I did have a large image that I added to the repository.   To fix, run the following command.

git config http.postBuffer 524288000

Thanks to:  http://flyingtomoon.com/2011/04/12/git-push-is-failed-due-to-rpc-failure-result56/

Filed Under: Tools Tagged With: git

Theme Localization

June 5, 2013 by Webhead

Wodpress theme localization seemed like an easy task.  And while all the info was there, I ran into several hiccups.

PoEdit

This piece of open source software seems like a great tool for localization until it doesn’t work.  For me, it didn’t read the source files correctly.  If the _ or _e functions were not at the start of a line it did not pick it up.  So my results were always empty until I moved one of the functions to the start of the line.

PoEdit doesn’t allow  you to edit.  Normally this is fine, but not good if the source files aren’t read correctly.

 

iCanLocalize PHP Text Scanner

This tool saved the day for me, but not without problems of it’s own.  The scanner apparently looks for the closing PHP tag “?>”.  In one of my files I had no closing tag so it didn’t work for me.  In another file I had it did have the closing tag, but it wasn’t at the end of the file so not all translations were picked up.

In the end I just edited my PHP file to not have the closing PHP tags or if there were a lot, I just edited the po file manually.  After having that set I opened up PoEdit and created the .mo binary.  What a pain.

 

WordPress documentation

The docs say to use languageCode_CountryCode.mo.  This is not true.  In your theme, just use languageCode.mo.

 

qTranslate

On the up side, after doing a ton of searching for my problems I found out about qTranslate.  It is a great WordPress plugin to make translating your website very easy.  It has a textbox/editor for each language when you are editing your post so you can easily understand what’s going on.  It also provides some decent API to use in your themes.

UPDATE:  qTranslate doesn’t really work “out-of-the-box” when using with WooCommerce.  so instead I used WPML.

WPML

WPML is a bit different from qTranslate.  Instead of translating your content inside each post, you translate it all on one page.   It’s pretty good in that  you can retrieve strings from plugins and themes and add localizations right inside of WordPress.  No need to handle .po files and go through the troubles i did.   WPML lets you translate the attributes of products and all strings throughout the checkout (and everything else).

 

Filed Under: Tools Tagged With: localization, wordpress

  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Go to page 4
  • Go to Next Page »

Primary Sidebar

Topics

apache apple block editor chrome cms css debug eCommerce embed firebug firefox git gmail goDaddy google hosting htaccess html html 5 IE crap image iPad iPhone javascript jquery linux localization mac os x ms sql mysql open source optimize php php 5.3 responsive rest api seo svg tinymce woocommerce wordpress wpengine xss yii youtube




Categories

  • Coding
  • Off the Shelf
  • Plugins
  • Random Thoughts
  • Server Stuff
  • Tools