I want to disable E-Mail verifcation / activation when a user signs up for my Wordpress site

when a new user registers an activation link is sent to his e-mail account. I want the user to enter his username, email address and password and straight register and be logged in without confirmation (confirmation does not prevent spam bots from signing up for the site, I don't care about it really!) is there a way to do it?
Category: Web

WordPress backend is loading as a list

So my backend is loading as just a bullet list, front end seems to be working fine. I'm not sure what made this happen. I've checked WordPress Integrity and it says it's fine. I've Reinstalled WordPress Core but it does nothing. Debugging shows nothing wrong. I've deactivated everything that does nothing to fix it. please help I can't seem to find any solutions for this problem as I can't find anyone else that has had this problem...
Topic: css Wordpress
Category: Web

How to Get Posts, Including Private Ones?

Currently in one of my php files, I retrieve all of the public posts like this: $posts = get_posts(array( 'posts_per_page' => -1, 'post_type' => 'post' )); However, this only returns public posts, and I would like to store all posts, both public and private, in the $posts variable. How can I accomplish this?
Category: Web

In a Time Series Problem, is it possible to forecast quantities by learning the patterns of other items? What are my options?

Suppose I own a store that sells a variety of apples and I have the following stats each month. Report Date Type of Apple (TA) Quantity Available(QA) Quantity Sold in the Past 30 days(QS30) Quantity Shipping In (QSI) Quantity Needed to Order(QN) Lets make the following assumptions/givens: There are three types of apples: red apples, green apples and yellow apples. T(1) denotes the first month and T(60) denotes the 60th month. QA @ T(i + 1) = QA@T(i) + QSI@T(i) …
Category: Data Science

Using BERT instead of word2vec to extract most similar words to a given word

I am fairly new to BERT, and I am willing to test two approaches to get "the most similar words" to a given word to use in Snorkel labeling functions for weak supervision. Fist approach was to use word2vec with pre-trained word embedding of "word2vec-google-news-300" to find the most similar words @labeling_function() def lf_find_good_synonyms(x): good_synonyms = word_vectors.most_similar("good", topn=25) ##Similar words are extracted here good_list = syn_list(good_synonyms) ##syn_list just returns the stemmed similar word return POSITIVE if any(word in x.stemmed for …
Category: Data Science

Redirect htaccess does not work correctly with my new wordpress site

I have an old website that works fine (www.example.com). I have created a new website (www.example.com/wordpress) and I thought I could use .htaccess to redirect as I've done it for other html websites in the past. I get the result: www.example.com/worpress/wordpress/wordpress......... until it's in error. Can someone help me? I used this command in .htaccess: Redirect permanent / http://www.example.com/wordpress/
Category: Web

how to train custom word2vec embeddings to find related articles?

I am beginner in machine learning. My project is to make search engine based on AI which shows related articles when we search on website. For this i decided to train my own embedding. I found two methods for this: One is to train network to find next word( i.e inputs=[the quick,the quick brown,the quick brown fox] and outputs=[brown, fox,lazy] Other method is to train with nearest words(i.e [brown,fox],[brown,quick],[brown,quick]). Which method should i use and after training how should i …
Category: Data Science

Help with Time Series prediction

I'm a complete n00b to both this stackexchange and ML so please don't flame me too bad. I am trying to make a prediction from Time Series data. I have about 10 years worth of 1-minute resolution price data for the S&P500. What I'd like to do is treat each DAY in the data as it's own series to predict what the price movement will be for the last 15 minutes of market hours. I've looked through several books, some …
Category: Data Science

Classification problem in pytorch with loss function CrossEntropyLoss returns negative output in prediction

I am trying to train and predict SVHN dataset (VGG architecture). I get very high validate/test accuracy by just getting the largest output class. However, the output weights are of large positive and negative numbers. Are they supposed to parsed as exp(output)/sum(exp(output)) to be converted to probability? Thank you!
Topic: pytorch cnn
Category: Data Science

How to get the value of input hidden html from text editor to custom page template?

I have 10 or more input hidden in 10 or more pages with different values in Wordpress text editor and I want to get the value using $_POST in a custom page template. How to do this? I tried to called the input hidden name in my custom page template but the value is not getting. Text editor <form method="POST"> <input type="hidden" name="segment" value="test"/> </form> Custom page template $segment = isset($_POST['segment']) ? $_POST['segment'] : '';
Category: Web

Azure Cloud SQL - Querying large number of rows with Python

I have a Python Flask application that connects to an Azure Cloud SQL Database, and uses the Pandas read_sql method with SQLAlchemy to perform a select operation on a table and load it into a dataframe. recordsdf = pd.read_sql(recordstable.select(), connection) The recordstable has around 5000 records, and the function is taking around 10 seconds to execute (I have to pull all records every time). However, the exact same operation with the same data takes around 0.5 seconds when I'm selecting …
Category: Data Science

AddToAny shortcode in the loop

I try to add addtoany shortcode in my custom loop page but the shared link stays always the same for each posts in the loop. <?php global $post; echo do_shortcode('[addtoany url="' . the_permalink() . '" title="' . the_title() . '"]') ?> I also tried with get_permalink(), get_permalink($post->ID), get_the_permalink()... but nothing works. It should work like this, according the official documentation. I don't understand why :/ EDIT Here is the full function: <?php add_filter( 'generate_do_template_part', function( $do ) { if ( …
Category: Web

New anaconda release for M1 (2022.05)

I am trying to install the new Anaconda for M1, I chose 64-Bit (M1) Graphical Installer (428 MB). However, when I download it, it still asks for Rosetta. Is that normal? I saw the demonstration here https://youtu.be/SPZRgwjclWQ and it doesn't ask for Rosetta. Also, do you think keeping Miniforge is a better solution?
Topic: conda anaconda
Category: Data Science

Gutenberg for WooCommece Product Page in WordPress 6.0+

I wanted to enable Gutenberg for My Single Product Description so I followed this guide https://dev.to/kalimahapps/enable-gutenberg-edit function activate_gutenberg_product( $can_edit, $post_type ) { if ( $post_type == 'product' ) { $can_edit = true; } return $can_edit; } add_filter( 'use_block_editor_for_post_type', 'activate_gutenberg_product', 10, 2 ); function enable_taxonomy_rest( $args ) { $args['show_in_rest'] = true; return $args; } add_filter( 'woocommerce_taxonomy_args_product_cat', 'enable_taxonomy_rest' ); add_filter( 'woocommerce_taxonomy_args_product_tag', 'enable_taxonomy_rest' ); function register_catalog_meta_boxes() { global $current_screen; // Make sure gutenberg is loaded before adding the metabox if ( method_exists( $current_screen, …
Category: Web

GridSearch multiplying the number of trees in XGboost?

I'm having an issue: after running an XGboost in a HalvingGridSearchCV, I receive a certain number of estimators (50 for example), but the number of trees is constantly being multiplied by 3. I don't understand why. Here is the code: model = XGBClassifier(objective='multi:softprob', subsample = 0.9, colsample_bytree=0.5, num_class= 3) md = [3, 6, 10, 15] lr = [0.1, 0.5, 1] g = [0, 0.25, 1] rl = [0, 1, 10] spw = [1, 3, 5] ns = [5, 10, 20] …
Category: Data Science

Meta query with JSON value

Im using post meta to store some value. Im having the following in wp_postmeta table: meta_key mykey meta_value a:2:{i:0;s:1:"5";i:1;s:1:"2";} I need to return posts which have meta_value of 2. My query: $args = array( 'post_type' => 'post', 'meta_key' => 'mykey', 'orderby' => 'meta_value_num', 'order' => 'ASC', 'meta_query' => array( array( 'key' => 'mykey', 'value' => '2', 'compare' => 'IN', ) ) ); $the_query = new WP_Query($args); But no posts returned... Where i made mistake?
Category: Web

When using padding in sequence models, is Keras validation accuracy valid/ reliable?

I have a group of non zero sequences with different lengths and I am using Keras LSTM to model these sequences. I use Keras Tokenizer to tokenize (tokens start from 1). In order to make sequences have the same lengths, I use padding. An example of padding: # [0,0,0,0,0,10,3] # [0,0,0,0,10,3,4] # [0,0,0,10,3,4,5] # [10,3,4,5,6,9,8] In order to evaluate if the model is able to generalize, I use a validation set with 70/30 ratio. In the end of each epoch …
Category: Data Science

How to make predictions of multiple input samples at once in tf 2 with keras

I am quite confused on the output of model.predict when after training I validate my model on around 6000 samples I use the following pseudo code: model.fit(...) predictions = model.predict(val_set) len(predictions) # == len(val_set) result: tensor array of shape=(len(tensor_array),14) (one prediction for each input sample) in production I currently use the following code to ocr image numbers: model = tf.keras.models.load_model('number_ocr_v2') def predict(list_images): global model print("length:") print(len(list_images)) #predictions = model.predict(list_images) # <- Same result predictions = model.predict_on_batch(list_images) print(len(predictions)) print(predictions) console Output: …
Category: Data Science

Redirect after login to current URL

I've my login box on any page of my WordPress and I'm trying to redirect to the same page after a user logs in. For example: If I make the login in the URL http://localhost/wordpress/category/sub-category/sold, redirect to the same URL. I've this in my functions.php but, using my $url doesn't work. How can make the redirection? function login_go_home(){ //$url ="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; wp_redirect(home_url()); exit(); }
Category: Web

How to make XGBOOST capture trend in time series forecasting?

I am trying to forecast some sales data with monthly values, I have been trying some classical models as well ML models like XGBOOST. My data with a feature set looks like this with a length of 110 months and I am trying to forecast for next 12 months, When it comes to XGBOOST, I've been spending time mostly on hyperparameter optimization with Gridsearch and also state-of-art packages like optuna. My currently best set of parameters looks like this, parameters …
Category: Data Science

Yoast - Custom Taxonomy - primary category

I have a Custom Taxonomy with the name country. I would like to display the primary category only. I have the yoast plugin installed and that is how I'm setting the primary category. I'm using this code I found to do the same thing but with post categories and it works well. <?php $primaryCat = new WPSEO_Primary_Term('category', get_the_ID()); $primaryCat = $primaryCat->get_primary_term(); $primaryCat = get_cat_name($primaryCat); $categories = get_the_category(); foreach( $categories as $category ) { $defaultCat = $category->name; $defaultCatLink = get_category_link( $category->term_id …
Category: Web

Multisite WordPress on a site that is more than 30 days old

Hoping to help others with this ticket as well I explain the process I followed to enable WordPress multisite on a site that is more than 30 days old and therefore displays the following message when creating the network: "Because your installation is not new, sites in your WordPress network must use subdomains. The main site in a subdirectory installation will need to use a modified permalink structure, potentially breaking existing links." I have the following code on the wp-config.php …
Category: Web

which statistical parameters are more useful to detect anomalies and outlier? mean max min var?

This time series contains some time frame which each of them are 8K (frequencies)*151 (time samples) in 0.5 sec [overall 1.2288 millions samples per half a second) I need to find anomalous based on different rows (frequencies) Report the rows (frequencies) which are anomalous? (an unsupervised learning method) Do you have an idea to which statistical parameter is more useful for it? mean max min median var or any parameters of these 151 sampling? Which parameter I should use? (I …
Category: Data Science

How to replace username with email address in users table

I have a custom built site that does not use usernames and everything requires use of their email address. The username is auto generated and looks bad in the table. I know there are filters and actions to work with custom columns within the users table but I have been looking for a way to replace the username with the email address. I know I can unset the username using manage_users_columns filter but I then loose the row actions. Is …
Category: Web

NLP Deep Learning Project (or Paper)

Kind of trying to find a good repos/course/paper or something that can get me up to speed for an NLP problematic. Exemple, Classify email or something else. Also that is relevant to latest state of art (transformers, multi heads etc). Thank you
Category: Data Science

How to label legit users when trying developing a bot flagging classification model?

I’m working on a project where I try to flag bots from legit users on social media. The data I collected is not labeled but I have labeled about 17% of it (22k users) thought different techniques. Finding bots was easy as they all have similarities with each other but it's different for legit users. In my labeled data, I have most if not all bots labeled but still have a ton of legit users to label which is really …
Category: Data Science

How to remove background (watermark) logo from image

I have been scratching my head for a while. What I have is a scanned PDF document with text and water marked logo at the back as in the below image. I want to do OCR over this, which becomes very difficult because of the logo. All the ratchet I've done so far is for coloured images where they can find contrast difference. I've hit a wall when solving the same for an B&W image as shown. Would love any …
Category: Data Science

Iframe disappears when author updates page

If a user has an author role and is listed as the author of a page, when they make changes to the page and click update, the changes are made but the iframe that was in the wysiwyg disappears and no longer shows on the back-end or front-end. If an administrator or editor makes the changes and saves it, the iframe stays. Besides changing the user role to editor, how do I prevent the iframe from disappearing? I tried having …
Category: Web

Input Signal Shape Optimization

I have a system, described by a black-box (a fully connected neural network), that takes as input a signal in time (let's say something similar to a sine wave) and returns a single scalar as output. My goal is to find the optimum signal that maximizes/minimizes the output. As constraints, the time average of the signal must be kept constant and the minimum and maximum value of the signal must be within a specific range. I wonder what kind of …
Category: Data Science

Getting featured image with PHP and not javascript from wordpress api _embed

Not having access to the functions file, I can't add the function to add the featured image to the API so I need to use wp-json/wp/v2/posts?_embed. With javascript I believe it is ._embedded['wp:featuredmedia']['0'].source_url so I tried with php after using wp_remote_get, $post->_embedded['wp:featuredmedia'][0]->source_url but the error I am getting is : Cannot use object of type stdClass as array
Category: Web

wp_nav_menu displaying all pages

As the title says, I'm using wp_nav_menu in header.php to load in the audience, secondary, and main menus and when I do, every menu contains every page - or at least many more pages than I selected for the menus. I'm having the hardest time trying to make this work for some reason, so any help is appreciated. Here's the code to register the menus in functions.php: // WordPress Menu Locations function diviecommerce_setup() { register_nav_menus(array( 'primary' => esc_html__( 'Main Menu', …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.