WordPress

WordPress is a free and open-source content management system (CMS) based on PHP and MySQL for creating websites and blogs. Features include a plugin architecture, a template system and strong management, customization and search systems; through its dynamic presentation of content, webmasters have the flexibility to create websites easily.

Share tech news, updates, or what's on your mind.

Sign up to Post

Wordpress $wpdb make sure the db connection is closed?

I have the foillowing query that locks a table while the query happens.  Is there anyway to confirm that the connection is closed after the Query is finished:

 public function custom_product_meta_save($product) {
            global $wpdb;
            if (isset($_POST['_upc'])) {
                $wpdb->query("LOCK TABLES 'wp_options' WRITE");
                if ($_POST['_upc'] != '') {
                    $product->update_meta_data('_upc', sanitize_text_field($_POST['_upc']));
                } else {
                    $available_upcs = get_option('tlg_upcs');
                    $upc_to_use = reset($available_upcs);
                    $product->update_meta_data('_upc', $upc_to_use);
                    $new_upc_list = array_diff($available_upcs, array($upc_to_use));
                    update_option('tlg_upcs', $new_upc_list);
                }
                $product->update_meta_data('_ebay_upc', $product->get_meta('_upc'));
                $product->update_meta_data('_amazon_product_id', $product->get_meta('_upc'));
                $product->update_meta_data('_amazon_id_type', 'UPC');
                
                $wpdb->query("UNLOCK TABLES");
                
            } else {
                $product->delete_meta_data('_upc');
                $product->delete_meta_data('_ebay_upc');
                $product->delete_meta_data('_amazon_product_id');
                

Open in new window

1
I currently have 20 WordPress Sites with Bluehost.com, and my goal is to migrate OUT to another service.  I am looking for recommendations for another service and any HOWTO's that might make this transition easier. Here are some parameters I have with Blue Host which may cost me much more with another provider.

Currently with Blue Host:
- Annual cost LESS THAN $200/year, and last was $99
- Unlimited site hosting... Note I have 20 wordpress installs currently, no extra cost
--  mysql DB service
-- CPanel admin interface, okay to use something else
-- SSH access
-- "Unlimited Storage", I currently use ~ 2GB of file store, and less than 500MB of DB storage

_- I do have an AWS account I can use, if that's the most cost effective... thus this post... I am having trouble with the cost effective part. Please note the current cost I put above.
0
Hi Guys
I am using StoreFront theme for WooCommerce. I like to display the Primary menu on all pages other than home. I have placed the function below, but not sure if I am on the right track.
I appreciate any help in advance.

# add_action( ‘init’, ‘remove_PrimaryNav’, 50 );
# function remove_PrimaryNav () {
#      if(!is_home()){
#      remove_action( ‘storefront_header’,’storefront_primary_navigation’, 50 );
#      }
# }
0
I am getting a 404 error on my website after I click on a product.  I was told to change the permalink to Custom Structure
http://essmen.com 
/%category%/%postname%/

I created the permalink.  I still get the same error.  I also change the httpaccess file to
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

I still have the same error.

Can someone help me? I am using the Aliplugin.
It also tried the sitemap.  Google has not crawled the page yet.
404-Error.png
Sitemap.png
0
Need a plan for getting cross-links to my website

I would like to start writing articles about my research, and using them to get cross-links to other news websites.

I have a Wordpress website and wonder what plug-ins can help.

Also, what kind of conventional word counts and page formats are most typical for me enticing other sites to want to cross-link?

Thanks
0
Hello, I have a 28 page PDF document that I want to add to a WordPress site, the problem that I am having is the only way I can incorporate it into the page is a link to the pdf but I wanted to see if I could put the page into the frame so the visitors can see the entire page when visiting this page not having to click on the link to see the pdf.
1
hey
so i am playing with wordpress gutenberg block dev. and already made some simple one. now i am trying to make a more complicated one of a slider.
everything works untill the save function where i get validation error and a bizzare notice about EndTag which i do not get.
this is my save function , for now i am just trying to save the slides titles. if i console log within the map, i do get what i want.
	save: function( props ) {
    const { slides } = props.attributes; 
    const id = props.attributes.id;
    
    const displaySlides = slides.map((slide) => {
      return (
        <div>
          <span>{slide.title}</span>
        </div>
      )
    });


    return (
      <div>
        {displaySlides}
      </div>
    )
  },

Open in new window


and here is the error i get in my dev tools:
validation error
what an i missing here? and what is it the EndTag thing?

best regards
0
Hi All,

I need a theme for my new website, which allows users to upload, download and stream videos on my website.

I have domain and cloud hosting.

for example : https://mybb.com/ 

This is the forum website which is open source I can download and upload these file to my hosting.
like same I need a website for videos.

thanks
0
I have the aliplugin.  I imported products to my website.  When I click on the product on the website it does not follow through.  Can you explain to me what is going on with my website http://essmen.com/.  I went to the website to see if my plugin is installed properly.  I see that it is installed properly.  I am using the ePN CPA network for the portal.  Can someone help me with this plugin for WP? Please see attachment to make sure that I have the plugin set up properly.Expert-Exchange.docx
0
Hello Experts,

Our website currently tracks visitors to our website. Everybody who comes into the site with a UTM_source gets put in a cookie and tracks it across the site. IF somebody applies for a job, it will append the UTM string to the url, so the source gets credit. The code is below, and on our website

<?php
	
/*------------------------------------*\
   Add UTM Cookies
   -- This sets Tracking Cookies. 
/*------------------------------------*/
function set_ad_cookies() {
	$vars = array('utm_source', 'utm_campaign', 'utm_medium');
  //$parsed = array();
  	foreach ($vars as $k) {
    	if (isset($_GET[$k]) && !isset($_COOKIE['orig_'.$k])) {
        	setcookie('orig_'.$k, $_GET[$k], 0, '/', $domains['cookie_domain']);
    	}
   	}
  
   	if (!isset($_COOKIE['orig_utmsource'])) {
	 	setcookie('orig_utmsource', $_GET['utm_source'], 0, '/', $domains['cookie_domain']);
	}
}
add_action('init', 'set_ad_cookies');
/*------------------------------------*\
  Append UTMs to links.
  - IF you have form submissions, or similar,
  - This will append the UTM string to
  - the end of the URL, so you can see which
  - ADD the user came from. Add your URL below. 
/*------------------------------------*/
function replace_links($text) {
	$url = explode('?', 'https://'.$_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
	$addCookiesToLink = "";
	if (strlen($url[1]) > 1) {
		$text = str_replace('yourwebsiteurl', 'yourwebsiteurl?' . $url[1], 

Open in new window

0
Hi Experts,

How much would someone charge for website maintenance under WordPress? I am not talking about backups, errors, etc., but simple text changes, new pages and some custom graphics like for the Featured Image?

I am actually not a designer myself, but a programmer, and I outsource graphics. But how much would a Featured Image cost on average, or how many hours?
0
What jQuery or Javascript function will act like an actual click?

I have a radio button on a wordpress / woocommerce page that when you click the radio button it causes the page to update.  If I set the button, it does not run the page update funtion, so I need it to be as if it were clicked.

The following does not work (But it does set the button as checked and it does run the page update)

 <input type="submit" class="submit button" style="margin-top:14px;float:none !important" value="<?php _e("Assign Customer to Order", 'manual_phone_orders') ?>">
                <?php IGN_Manual_Phone_Orders_Core::add_tax_exempt_field() ?> 
            <?php wp_nonce_field("opc_customer_selected", "opc_customer_selected"); ?>
                    <?php
            $user_meta = get_userdata($userid);
            $user_roles = $user_meta->roles; //array of roles the user is part of.
            if (in_array('customer_wholesale', $user_roles)) {
                echo "&nbsp; - &nbsp; <span style='background-color: #FFFF00'><b>This is a Wholesale Customer</b></span>";
                ?>
                <script>
                    $ = jQuery
                    $(".ignitewoo_one_page_tax_exempt").prop("checked", true).trigger("change");
                    jQuery('body').trigger( 'update_checkout' );          
                </script>
                <?php
            } else {
                ?>
                <script>
                    $ = jQuery
                    

Open in new window

0
I have a WP theme.  I need to upload xls to the theme. Can you help me?  The website is www.essmen.com
0
We have moved a WordPress site over to HTTPS, however some of the scripts / css files are still being referenced on http - resulting in a broken site as these requests are blocked due to mixed active content violation.

Summary
* This is a WP site that runs off a menu option of the main site - which is not WP. In other words you have www.domain.com - normal site and from there a link to www.domain.com/blog - this is a WP site specifically to run the blog.
* The site is hosted on one domain but dashboard (wp-admin) is hosted on a different domain
* The requests to the blocked content files are on the admin domain (resource domain which I think is an Amazon S3 bucket - but I don't have confirmation on this - my access is limited)
* Requests to the domain a redirected to https://
* The site url's (admin and site) in the settings were changed to https
* The links in question are not in the database but are generated with the WP enqueue_scripts and enqueue_styles - we have done the URL search and replace on the database but that had no effect on the scripts and JS files
* The Wordpress HTTPS plugin is installed (https://wordpress.org/plugins/wordpress-https) and the SSL Host is configured to be the Admin domain.

I am under pressure to get this working but have N other things to do so don't have to fiddle about with WP.

Hoping someone out there has seen this before and knows what has been missed.


I suspect that as part of the enqueue scripts call because the …
0
Need to create WordPress based photo album

I have a WP site and find the format of Flickr a bit unworkable. For example, I want to provide a URL to my tour attendees, and show my photo library after they provide their First Name and an Email address.

Do you know of any WP plug ins that could help me create a virtual tour image photo gallery?

Thsnks
0
Quote from another wordpress question:
The only file in your root WordPress folder that you should need to keep (given your screenshot) is the wp-config.php file, unless you've got non standard customisations to the site. You should be able to delete the wp-admin and wp-includes folders (these are the "core" folders David mentioned) and reinstall them from a fresh copy of WordPress.

Cleaning a site isn't easy. You'll very likely have infected files in your plugins, and as David mentioned it's quite a process to remove and reinstall them. On top of that, you'll need to:
* reset all admin user passwords in the database, and probably editor and author user passwords too (and maybe more depending on the site)
* change the database user password on the server and in the wp-config.php file
* change the "authentication unique keys and salts" in the wp-config.php file (there's a note in the file on how to do that)

To be completely thorough, the above should be done offline and without opening WordPress, to avoid reinfection part way through. There may also be other things in the WordPress database that are compromised and open the site up for reinfection. I've found that generally I can clean a site manually without being completely thorough, but it does take quite some time.

Updated wordpress version 4.9.8 (from 4.9.x)
I copied the infected site to my  windows desktop computer.
https://wordpress.org/plugins/wp-clone-by-wp-academy/
and copied using …
0
My site went down due to Maria DB increasing in memory usage.  I am running atop and went through the logs and saw it increase in size enough to take the server down.

I ran mysqltuner on the DB and got these results

-------- Recommendations ---------------------------------------------------------------------------
General recommendations:
    Control warning line(s) into /var/log/mariadb/mariadb.log file
    Control error line(s) into /var/log/mariadb/mariadb.log file
    Run OPTIMIZE TABLE to defragment tables for better performance
      OPTIMIZE TABLE `thefruga_smf_test`.`smf_log_errors`; -- can free 47.8366432189941 MB
    Total freed space after theses OPTIMIZE TABLE : 47.8366432189941 Mb
    Restrict Host for user@% to user@SpecificDNSorIp
    MySQL was started within the last 24 hours - recommendations may be inaccurate
    Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=1
    Adjust your join queries to always utilize indexes
    When making adjustments, make tmp_table_size/max_heap_table_size equal
    Reduce your SELECT DISTINCT queries which have no LIMIT clause
    Performance schema should be activated for better diagnostics
    Consider installing Sys schema from https://github.com/mysql/mysql-sys
    Before changing innodb_log_file_size and/or innodb_log_files_in_group read this: http://bit.ly/2wgkDvS
Variables to adjust:
    query_cache_size (=0)
    query_cache_type (=0)
    query_cache_limit

Open in new window

0
I bought a theme from themeforest.com
If I backup wordpress will I still keep my theme?
Or is there a special unique way I need to backup to keep theme.
0
Hi Experts

Can anyone tell me what a landing page is really?

I assume, just a single page with limited info and a form to collect info?

Does emphasis needs to go into design? Can Wordpress be used, or hand code?

Any info would be appropriated
0
linux shared hosting

how can I back up wordpress
while logged onto wordpress.  
is there a folder and database

I want to do this without cpanel
0
Hi Experts,

I just got Yoast For WordPress Premium and Paid $89, but my account says renew every year.

Their website hints that optional years are only if you want ongoing support and upgrades. Does anyone know if I don't continue with additional years, will my SEO rankings fall and Yoast stop working?
0
I have a php function that I want to call from another php file.  This function creates a button and places a message in Order Notes.  Also, the function isn't the only function in functions.php.

Here is the function
add_action ('woocommerce_before_order_notes', 'member_note', 10); 
function member_note (){
$code = <<< EOT
<button style= "background-color:green; color:white;" onclick="myFunctionMember()">MEMBERSHIP</button>
<script>
function myFunctionMember() {
    document.getElementById("order_comments").innerHTML = "I want membership";
}
</script>
EOT;
echo $code;
}

Open in new window


This function needs to be at the bottom of this yellow box.  https://gyazo.com/fad06970c1cec8be092987e46331a7c3 which is being created with this code.  

<?php if (($val >= 100) && ($val <= 300)) { ?>
<p style="color: black; font-weight:bold; text-align:center; margin:0 auto; background-color: yellow; padding-top:6px; padding-bottom:6px; font-size:16px; font-family:Verdana, Arial, Helvetica, sans-serif;">
		<span class="heading">You've Qualified For FREE SmartStart Membership!</span><br />
		<br />
  $15 product credit for future use, shipping promotions and much more.</span>
	  <br /><br />
	Click The Green Membership Button To Recieve Your Membership Benefits</p>


<?php include('functions.php');
	$returning_value = member_note();								   
echo $returning_value;
 } ?>

Open in new window


This code is at qv_contest.php

You can see my attempt that resulted in this error:

Fatal error: Cannot redeclare member_note() (previously declared in C:\xampp\apps\wordpress\htdocs\wp-content\themes\flatsome-child\functions.php:25) in C:\xampp\apps\wordpress\htdocs\wp-content\themes\flatsome-child\functions.php on line 33

Open in new window

0
I noticed a many new .php files on my shared linux server that I did not create
Some php files had eval command.
I would want to delete this domain but I dont want to ruin the wordpress installation that is already there.

Which files/folders do not belong in a wordpress that has been installed in past year.

wordpress.
0
Greetings mates,

We have been struggling for the past three days trying to connect wordpress to sql server using iis.

We are using iis because management doesn't want us to use WAMP or XAMMP.

Anyway, we used Microsoft web Platform installer to install, PHP and PHP Manager.

Configured, tested and phpinfo is rendered fine.

We downloaded wp-db-abstraction plugin, created a folder called MU-Plugins and put the  wp-db-abstraction plugin inside this folder,  grabbed wp-db.php that came with this plugin and put it inside the wp-content folder.

Then we downloaded sql server driver for php.

The version of php we installed is 5.6 ( I know).

We registered these dlls in php.ini. Then copied these dlls into the php/ext folder.

The version registered is for php 5.6

Then we fired wordpress =  http://servername/index.php and then got this error:

Error establishing database connection

This either means that the username and password information in your wp.config.php incorrect or we can't contact the database server at xxxxxxxxxxxxx.

Are you sure you have the connect username?
Are you sure you have the correct password?
Are you sure you have the correct hostname?
Are you sure database server is running?


Does any one of you experts please help me out on this?

Thank you in advance
0
PHP Error Notice: Notice      Trying to get property of non-object

What am I not understanding about this notice and the way the following is written?

wp_localize_script('tlg_admin', 'tlg_admin', array('screenname' => $screen->base, 'ajax_url' => admin_url('admin-ajax.php'), 'post_id' => $post->ID));

Open in new window

0

WordPress

WordPress is a free and open-source content management system (CMS) based on PHP and MySQL for creating websites and blogs. Features include a plugin architecture, a template system and strong management, customization and search systems; through its dynamic presentation of content, webmasters have the flexibility to create websites easily.