how to remove font awesome from my page load - php

baytalebaa.com
wordpress,
first
1- search for "fontawesome" using inspect
the following link casing my website to slow down by 2 sec
and i want to remove it .
2- http://baytalebaa.com/?ngg_serve_fontawesome_css=1&ver=4.6.1
it seems that nextgen plugin is calling it , how to stop it ? please help
i have tried the following
wp_dequeue_style( 'fontawesome' );
didnt work...

You can try to edit the plugin directly and serve the CDN version of the plugin, or remove the reference all together.
An alternative option is to serve the plugin files directly from CDN and distribute them via Cloudfront or an alternative service if you are not doing so already.
W3 Cache is a great plugin for managing issues like this.

You can try following code on page load. this might be helpful for you.
function remove_unwanted_css(){
wp_dequeue_style(‘font-awesome’, ‘https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css’);
}
add_filter(‘wp_print_styles’, ‘remove_unwanted_css’);

Related

Disable template caching for development in OpenCart 3

I am making changes in my theme templates in OpenCart 3. Due to template caching I have to clear cache every time under "storage/cache" directory. It is very annoying when working and previewing changes frequently during development. Please provide some solution how we can configure caching according to production and development environment.
Note: I have already searched for solutions online but there is no solution related to template caching. Solutions are available to disable image caching but "Image Caching" and "Template Caching" are different features provided in Opencart.
You might need to upgrade to a more recent version of OpenCart3 - the first one (3.0.0.0) didn't have a way of doing this in the GUI.
More recent versions, such as 3.0.2.0, have a gear on the admin dashboard. Click the gear and you get options to disable caching.
Another way to do this:
Open to system\library\template\Twig\Cache\Filesystem.php, find following lines of code
public function load($key)
{
if (file_exists($key)) {
#include_once $key;
}
}
Comment out as in the following code:
public function load($key)
{
// if (file_exists($key)) {
// #include_once $key;
// }
}
This will remove the template cache of the twig and recreate every time, once development is over you have to remove the comment.
You can also do this from CODE directly if you have the access. Go to this file path below via ftp or cPanel:
system\library\template\Twig\Environment.php
Find
$this->debug = (bool) $options['debug'];
Replace:
$this->debug = (bool) true;
Opencart Version 3.0.2.0
I was having same problem, try working in theme editor or the actual raw twig file, after an hour or two i tried this it worked.
Delete the changes in theme editor and got back editing actual twig file
my screen shot
I think you edit the template as the path: Design->Theme Editor before.
Clear all of the date in the oc_theme data table of your database.
Scott's answer is best but in case it's not available due to version or you want to disable it programmatically you can do this anywhere before the twig is rendered:
$this->config->set('template_cache', false);
in OC 3.0.3.6, if you have some twig extension, like twig managers, after changes maded you should select that extention in modifications and refresh push button on top right corner.
P.S. loose whole day to find this, hope it helps someone
This is similar to Scott's answer but just on the database/backend. In case you can't rely on the UI and can only access the DB (like me, I'm messing up with the UI) it's on settings table search for 'developer_theme' key and set it to false or 0.
UPDATE `oc_setting` SET `value` = '0' WHERE `oc_setting`.`key` = 'developer_theme';

How to wp_dequeue_script or wp_deregister_script jquery (not effected) file from wp theme

NOTE: I already use wp_dequeue_script or wp_deregister_script but not successfull
Here is the scenario, i make a image slider plugin that use jquery-cycle2 and it work successfully.
There is a user who used a wp theme and in theme there is a jquery-cycle1, now when he install my plugin the jquery-cycle1 and jquery-cycle2 conflicts, when user delete the jquery-cycle1 file all things work fine and perfectly but i don't want to delete file by user.
Now i am trying that when user install my plugin the jquery-cycle1 in theme close or deregister or stop its effect.
I get file from theme successfully
if((file_exists($theme_file_path."/jquery.cycle.all.js"))){
echo "yes";
}
but i have no idea to close jquery-cycle1 file or stop its effect.
Last Option: I have last solution that delete the file from theme but its my last option.
Please any suggestions, help me.
You will have to place an incompatibility notice on your theme.
It is not possible to attempt to detect the existence of script from server side. You are able to detect queued scripts via the word press methods, however, this assumes that the user has not simply linked the file with a <script></script> tag. The file_exists method assume the file is stored on the server itself - it could be linked from a CDN or another server.
Also, whatever methods you use to detect and remove jQuery-Cycle; You are going to break any feature on the site that uses the existing plugin.
Thus, any solution you able to devise would either be extremely complicated, or would not be generalised enough to account for all these possibilities.
You may be able to use the following to prevent loading your script
if (jQuery().cycle) {
// Script already loaded
console.log("Error: Another version of jQuery-Cycle is already loaded!");
} else {
// Load your script
}
but this cannot unload what is already loaded.
There is a simple hack you can do on you end. In the Cycle2 source replace all $.fn.cycle with $.fn.cycle2 and ).cycle( to ).cycle2(.
I am using the source from here http://malsup.github.io/jquery.cycle2.js
After that You can access it like
$("#id").cycle2({option})
Here is a demo http://jsfiddle.net/33g6z79h/
Here i assume that you are not using cycle events http://jquery.malsup.com/cycle2/api/#events
and cycle extra transitions.
If you are using it you can make a fiddle for your cycle2 implementation and i would be glad to help :)

image upload buttons are missing in magento in back end

I am new to Magento...Installed 1.7 community Edition.
I have heard great deal about it and so far I was not impressed..anyway I am trying to add images to a Product but 'Browse files' and 'Upload' buttons are missing from the backend.
I have tried several solutions from online like:
-copying 'media' folder from 'adminhtml' folder to 'frontend',
-clearing caches,
-reforming indices,
-upgrading to latest flash player.
Nothing seems to work. If any one found solution to this problem please let me know.
These buttons are coming from flash.So check your media folder on following location
design/adminhtml/default/default/template/media
if there is no media folder then copy from fresh magento
This will solve your problem :)
Magento image uploading issue is related to flash. You need to change the settings of your browser. If you are using chrome,
Go chrome settings, or by typing chrome://settings/content
Go to Content settings => flash
Turn on Allow site to run flash
Turn off ask first
And in Firefox, you don't need to do anything, if your flash player is outdated, you need to update it
Go to
chrome://settings/content/flash
Add you website url in allow tag
Then refresh your admin panel
if git is used It's also a good to check .gitignore. it's easy to ignore "media/" instead of "/media/". Deeper media directory contains swf upload buttons.
The upload button is not displayed if JavaScript Variables
maxUploadFileSizeInBytes and maxUploadFileSize are not properly configured in the following files:
/app/design/adminhtml/default/default/template/media/uploader.phtml
/app/design/adminhtml/default/default/template/media/cms/browser/content/uploader.phtml
The variables are declared as follows:
maxUploadFileSizeInBytes = <?php echo $this->getDataMaxSizeInBytes() ?>;
maxUploadFileSize = '<?php echo $this->getDataMaxSize() ?>';
You can directly edit:
maxUploadFileSizeInBytes = 10485760; /* 10.48576 MB */
maxUploadFileSize = '104857600';
The getDataMaxSizeInBytes() and getDataMaxSize() are defined in the file:
/app/code/core/Mage/Adminhtml/Block/Media/Uploader.php
If your server is running with HHVM, the parameters PHP post_max_size and upload_max_filesize are available under the names hhvm.server.max_post_size and hhvm.server.upload.upload_max_file_size.
For this he will have to modify the appeal of these parameters in the php file Uploader.php, here's how:
Copy the file in the Local Uploader.php architecture:
/app/code/local/Mage/Adminhtml/Block/Media/Uploader.php
replace the following lines:
public function getPostMaxSize()
{
return ini_get('post_max_size');
}
public function getUploadMaxSize()
{
return ini_get('upload_max_filesize');
}
by the following:
public function getPostMaxSize()
{
$post_max_size = ini_get('post_max_size');
return $post_max_size ? $post_max_size : ini_get('hhvm.server.max_post_size');
}
public function getUploadMaxSize()
{
$upload_max_filesize = ini_get('upload_max_filesize');
return $upload_max_filesize ? $upload_max_filesize : ini_get('hhvm.server.upload.upload_max_file_size');
}
Cordially.
G
I had problem updating to magento 1.9.1, the problem was solved by copying the folder /app/design/adminhtml/default/default/template/dull
into the new magento instance.
Image upload button is a flash button so you have to download Flash Player.
You can download flash player from following link :
http://get.adobe.com/flashplayer/otherversions/
After installing flash player just need to restart your browser, now you can see the image upload button.
I found this issue in admin area. First Enable the Flash of Browser then Recheck.
These buttons use FLASH.
So if your browser does not support flash - then they will not appear.
Ensure that the app/design/adminhtml/default/default/template/media folder exists and that there are 2 files within it.
editor.phtml
uploader.phtml
Ensure that the skin/adminhtml/default/default/media folder exists and that there are 3 files within it.
flex.swf
uploader.swf
uploaderSingle.swf
If you have created your own theme (ie Theme: "mytheme" and Package "mypackage") then ensure the above applies for:
app/design/adminhtml/mytheme/mypackage/template/media
skin/adminhtml/mytheme/mypackage/media
I hope this helps.
I had the same issue and sorted by doing the following settings in Google Chrome:
Go to menu in the right corner > settings > Advanced > Privacy and Security > Content Settings > Flash > In the allow section click 'ADD' button and type your website URL.
You can check the following URL if any problem:
http://www.alvipixels.co.uk/blog/magento-product-image-upload-button-not-showing.php
I had this problem after emptying all my caches in Opera. I just added the exception of my site to the flash setting. Just make sure it is the complete url starting with http(s). I one case I opened the flash player properies and first deleted all content using the delete all button on the advanced tab.
If it is working in one browser it is usually NOT a magento code error in another browser.
Google Chrome is blocking these buttons because they are flash. follow these steps:
Open Google Chrome
Click on the three dots in the top right hand corner of the browser
Click on settings
Scroll down to advanced and click expand
Scroll down to Privacy and security and click on content setting
Click on flash
Under allow click on add
Copy the homepage link to the website
Here's a tutorial on fixing Magento upload buttons in more details

How to load MediaWiki's WikiEditor?

I have an old skin that I need to adapt to the new MediaWiki 1.18 which has this new WikiEditor. If I set the skin to Simple or any other theme than the custom theme, then I see the WYSIWYG editor (WikiEditor), but if I use a custom skin I don't see it.
I think I'm missing something, I've wasted half a work day trying to figure what am I missing but the skin seems to be just like the other skins. I checked MediaWiki homepage but they don't tell what do I need to do to get this WikiEditor to load.
To confirm: the WikiEditor source codes are never loaded, i.e. the ResourceLoader does not load them, but I do not know how to make it load.
From Extension:WikiEditor:
For 1.18 and later the extension already comes with your MediaWiki package.
You only need to install and configure it as described below:
Add the following line to your LocalSettings.php:
require_once( "$IP/extensions/WikiEditor/WikiEditor.php" );
To enable use of WikiEditor by default but still allow users to disable it in preferences, use something like...
$wgDefaultUserOptions['usebetatoolbar'] = 1;
$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;
$wgDefaultUserOptions['wikieditor-preview'] = 1;
Starting in 1.18, skins should use the following instead of writing their own HTML HEAD sections:
$this->html( 'headelement' );
headelement includes the opening body tag, so everything between that and doctype should be removed from your legacy code. This will of course break backwards compatibility with pre-1.18 mediawiki.
Your skin may also need to be modified to use SkinTemplate rather than BaseTemplate in its class declaration.

Minimalist Wiki like script

I'm trying to find a simple wiki like script to setup a personal directory, browser favorites simply doesn't do anymore and i have lots of small files on my flash drive
Desired features
file upload
not bloated
works on a common webhost (aka php)
Thanks in advance
Google Sites functions as a Wiki, and you don't have to make your site public. You can upload files, but there's a 100MB limit for a site. The big advantage here (IMO) is the fact that you don't have to worry about setting up hosting at all.
It has a WYSIWYG editor, so that's a minus if you're really into some particular Wiki syntax, I guess.
Another (non-hosted) option would be TiddlyWiki, which is completely implemented in Javascript and meant to be used on a USB drive, primarily.
I recommend Dokuwiki. Uses text files instead of a database.
A couple of people have recommended Tiddlywiki. I've used it for a simple wiki setup... It's nice, fast, and easy.
You mentioned the need for web-access... Tiddlywiki combined with TiddlyHome is what I use for a simple, single-html-page wiki, which can be used both offline and online...
Another possibility is to use one of the new saving options listed at https://tiddlywiki.com/#Saving, including a Node.js or PHP server, or Google Drive/Dropbox/WebDAV (Sharepoint) integration.
I think this could help you find one that suits your needs: http://www.wikimatrix.org/
I found also this nice script: Hatta
Checkout LionWiki - http://lionwiki.0o.cz
It works from just one file and it's dead simple.
Here's one:
<?php function p($c){$r=preg_replace(array("~^ +([^\n]+)~m",'~^-\s+(.*)$~m',
"~-{4,}\r?\n~",'~(http(?:s)?)://([^\s]+)~i','~\n~'),array('<code>$1</code>','<li>$1',
'<hr>','<a href=$1://$2>$2</a>','<br>'),$c);preg_match_all('~([A-Z]\w+){2,}~',$r,
$x);foreach(array_unique($x[0])as$m){$r=str_replace($m,x($m)? "<a href=?$m>$m</a>":
"$m<a href=?e=$m>?</a>",$r);}return$r;}function f($f){#mkdir('wik');return
#file_get_contents("wik/$f.w");}function b($b){echo"<h1><a href=?$b>Backlinks $b"
."</a></h1><div id=c>";foreach(glob('wik/*.w')as$f){$f=substr($f,4,-2);if(strpos(
f($f),$b)!==false)echo"<a href=?$f>$f</a><br>";}echo"</div>";}function x($f){
return file_exists("wik/$f.w");}function e($p){$p=$p?$p:$_GET['e'];echo"<h1>Edit"
." $p</h1><form action='?$p' method=post><textarea name=c cols=50 rows=10>".f($p)
."</textarea><br><input type=submit value=Save>";}$p=preg_replace('~(e|b)=(.*)~'
,'',$_SERVER[QUERY_STRING]);$c=$_POST[c];$e=$_GET[e];$b=$_GET[b];if(!$p&&!$e)$p=
'MainPage';if($c){#file_put_contents("wik/$p.w",htmlspecialchars($c));header(
"Location: ?$p");}echo"<title>Wik Wiki</title>";if(!$e){if(!$b){echo x($p)?
"<h1><a href=?b=$p>$p</a></h1><div id=c>".p(f($p))."</div><hr><a href=?e=$p>"
."Edit</a> | <small>Modified: ".date('d.m.Y # H:i:s', #filemtime("wik/$p.w"))
:e($p);}else b($b);}else e($e);
It's from http://c2.com/cgi/wiki?WikWiki. It doesn't have file upload but you should be able to add it without bloating. I've used it as a private notepad and it works well, you just have to make sure the web server has write permissions on the wik directory

Categories